From a31a875c0ce75bb3eb7eb7a777fbcb5eb7666394 Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 23 Nov 2024 01:22:24 +0100 Subject: [PATCH] add timeline information to the /items endpoint --- ...ve_item_container_itemplacement_comment.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 core/inventory/migrations/0007_remove_item_container_itemplacement_comment.py diff --git a/core/inventory/migrations/0007_remove_item_container_itemplacement_comment.py b/core/inventory/migrations/0007_remove_item_container_itemplacement_comment.py new file mode 100644 index 0000000..24c0f75 --- /dev/null +++ b/core/inventory/migrations/0007_remove_item_container_itemplacement_comment.py @@ -0,0 +1,36 @@ +# Generated by Django 4.2.7 on 2024-11-23 00:19 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('inventory', '0006_alter_event_table'), + ] + + operations = [ + migrations.RemoveField( + model_name='item', + name='container', + ), + migrations.CreateModel( + name='ItemPlacement', + fields=[ + ('id', models.AutoField(primary_key=True, serialize=False)), + ('timestamp', models.DateTimeField(auto_now_add=True)), + ('container', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='item_history', to='inventory.container')), + ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='container_history', to='inventory.item')), + ], + ), + migrations.CreateModel( + name='Comment', + fields=[ + ('id', models.AutoField(primary_key=True, serialize=False)), + ('comment', models.TextField()), + ('timestamp', models.DateTimeField(auto_now_add=True)), + ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='inventory.item')), + ], + ), + ]