110 lines
2.8 KiB
Python
110 lines
2.8 KiB
Python
from django.db import models
|
|
|
|
|
|
class Plant(models.Model):
|
|
|
|
id = models.BigAutoField(primary_key=True)
|
|
|
|
company_id = models.IntegerField()
|
|
|
|
code = models.IntegerField(unique=True)
|
|
|
|
name = models.TextField(unique=True)
|
|
|
|
address = models.TextField()
|
|
|
|
created_at = models.DateTimeField()
|
|
|
|
updated_at = models.DateTimeField()
|
|
|
|
deleted_at = models.DateTimeField(
|
|
blank=True,
|
|
null=True
|
|
)
|
|
|
|
warehouse_number = models.TextField(
|
|
blank=True,
|
|
null=True
|
|
)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'plants'
|
|
|
|
class InvoiceValidation(models.Model):
|
|
|
|
plant = models.ForeignKey(
|
|
Plant,
|
|
on_delete=models.DO_NOTHING,
|
|
db_column='plant_id'
|
|
)
|
|
|
|
invoice_number = models.CharField(max_length=100)
|
|
|
|
quantity = models.IntegerField(null=True)
|
|
|
|
scanned_status = models.CharField(max_length=50)
|
|
|
|
serial_number = models.CharField(
|
|
max_length=100,
|
|
null=True
|
|
)
|
|
|
|
created_at = models.DateTimeField()
|
|
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = "invoice_validations"
|
|
|
|
class Users(models.Model):
|
|
|
|
id = models.BigAutoField(primary_key=True)
|
|
|
|
name = models.CharField(max_length=255)
|
|
|
|
email = models.CharField(max_length=255)
|
|
|
|
password = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = "users"
|
|
|
|
class Lines(models.Model):
|
|
id = models.BigAutoField(primary_key=True)
|
|
plant = models.ForeignKey(
|
|
'Plant',
|
|
models.DO_NOTHING,
|
|
db_column='plant_id'
|
|
)
|
|
name = models.TextField()
|
|
type = models.TextField()
|
|
created_at = models.DateTimeField()
|
|
updated_at = models.DateTimeField()
|
|
deleted_at = models.DateTimeField(blank=True, null=True)
|
|
line_capacity = models.TextField(blank=True, null=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'lines'
|
|
|
|
class BreakdownLogs(models.Model):
|
|
id = models.BigAutoField(primary_key=True)
|
|
|
|
plant = models.ForeignKey('Plant',models.DO_NOTHING,db_column='plant_id')
|
|
line = models.ForeignKey('Lines',models.DO_NOTHING,db_column='line_id')
|
|
machine_name = models.CharField(max_length=255)
|
|
reason = models.TextField(blank=True,null=True)
|
|
breakdown_at = models.DateField(blank=True,null=True)
|
|
breakdown_time = models.TimeField(blank=True,null=True)
|
|
down_time = models.TimeField(blank=True,null=True)
|
|
created_at = models.DateTimeField(blank=True,null=True)
|
|
created_by = models.TextField(blank=True,null=True)
|
|
updated_at = models.DateTimeField(blank=True,null=True)
|
|
updated_by = models.TextField(blank=True,null=True)
|
|
deleted_at = models.DateTimeField(blank=True,null=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = "breakdown_logs" |