Files
eam-project/assets/migrations/0001_initial.py
T
2025-05-23 14:44:12 +08:00

84 lines
3.8 KiB
Python

# Generated by Django 3.2 on 2022-05-27 06:01
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('products', '0001_initial'),
('vendors', '0001_initial'),
('dashboard', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Asset',
fields=[
('status', models.IntegerField(default=1)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_by', models.IntegerField()),
('updated_by', models.IntegerField()),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('name', models.CharField(blank=True, max_length=255, null=True)),
('serial_no', models.CharField(blank=True, max_length=45, null=True)),
('price', models.FloatField(blank=True, null=True)),
('purchase_date', models.DateField(blank=True, null=True)),
('warranty_expiry_date', models.DateField(blank=True, null=True)),
('purchase_type', models.CharField(blank=True, max_length=45, null=True)),
('organization', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='dashboard.organization')),
('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='products.product')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Specification',
fields=[
('status', models.IntegerField(default=1)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_by', models.IntegerField()),
('updated_by', models.IntegerField()),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('name', models.CharField(blank=True, max_length=255, null=True)),
('value', models.CharField(blank=True, max_length=255, null=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='AssetSpecification',
fields=[
('status', models.IntegerField(default=1)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_by', models.IntegerField()),
('updated_by', models.IntegerField()),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('asset', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='assets.asset')),
('specification', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='assets.specification')),
],
options={
'abstract': False,
},
),
migrations.AddField(
model_name='asset',
name='specifications',
field=models.ManyToManyField(blank=True, null=True, related_name='asset_specification', through='assets.AssetSpecification', to='assets.Specification'),
),
migrations.AddField(
model_name='asset',
name='vendor',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='vendors.vendor'),
),
]