51 lines
2.9 KiB
Python
51 lines
2.9 KiB
Python
# Generated by Django 3.2 on 2023-01-04 14:16
|
|
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import simple_history.models
|
|
import uuid
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('dashboard', '0018_auto_20230104_1455'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
('products', '0013_alter_product_status'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='HistoricalProduct',
|
|
fields=[
|
|
('status', models.BooleanField(default=True)),
|
|
('created_at', models.DateTimeField(blank=True, editable=False)),
|
|
('updated_at', models.DateTimeField(blank=True, editable=False)),
|
|
('created_by', models.CharField(blank=True, max_length=255, null=True)),
|
|
('updated_by', models.CharField(blank=True, max_length=255, null=True)),
|
|
('is_deleted', models.BooleanField(default=False)),
|
|
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
|
|
('name', models.CharField(blank=True, max_length=255, null=True)),
|
|
('product_picture', models.TextField(blank=True, max_length=100, null=True)),
|
|
('manufacturer', models.CharField(blank=True, max_length=255, null=True)),
|
|
('description', models.TextField(blank=True, null=True)),
|
|
('history_id', models.AutoField(primary_key=True, serialize=False)),
|
|
('history_date', models.DateTimeField(db_index=True)),
|
|
('history_change_reason', models.CharField(max_length=100, null=True)),
|
|
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
|
|
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
|
|
('organization', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='dashboard.organization')),
|
|
('product_category', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='dashboard.productcategory')),
|
|
('product_type', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='dashboard.producttype')),
|
|
],
|
|
options={
|
|
'verbose_name': 'historical product',
|
|
'verbose_name_plural': 'historical products',
|
|
'ordering': ('-history_date', '-history_id'),
|
|
'get_latest_by': ('history_date', 'history_id'),
|
|
},
|
|
bases=(simple_history.models.HistoricalChanges, models.Model),
|
|
),
|
|
]
|