0026_batchlogmodel.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Generated by Django 4.1.2 on 2025-07-22 20:03
  2. from decimal import Decimal
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. ('bound', '0024_alter_batchlogmodel_goods_qty_and_more'),
  8. ('container', '0025_alter_containerdetaillogmodel_log_type'),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='batchLogModel',
  13. fields=[
  14. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  15. ('log_type', models.CharField(choices=[('create', '创建'), ('update', '更新'), ('delete', '删除'), ('out', '出库'), ('cancel_out', '取消出库'), ('status_change', '状态变更')], max_length=20, verbose_name='日志类型')),
  16. ('goods_code', models.CharField(max_length=50, verbose_name='货品编码')),
  17. ('goods_desc', models.CharField(max_length=100, verbose_name='货品描述')),
  18. ('old_goods_qty', models.DecimalField(blank=True, decimal_places=3, default=Decimal('0'), max_digits=10, null=True, verbose_name='原数量')),
  19. ('new_goods_qty', models.DecimalField(blank=True, decimal_places=3, default=Decimal('0'), max_digits=10, null=True, verbose_name='新数量')),
  20. ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
  21. ('batch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='logs', to='bound.boundbatchmodel')),
  22. ],
  23. options={
  24. 'verbose_name': '批次日志',
  25. 'verbose_name_plural': '批次日志',
  26. 'db_table': 'batch_log',
  27. 'ordering': ['-create_time'],
  28. },
  29. ),
  30. ]