Added transactions and updated models to reflect transactions

This commit is contained in:
Keannu Christian Bernasol 2023-12-08 23:00:15 +08:00
parent d915852632
commit 2c8cc87cbe
39 changed files with 635 additions and 291 deletions

View file

@ -1,4 +1,4 @@
# Generated by Django 4.2.7 on 2023-12-02 12:25
# Generated by Django 4.2.7 on 2023-12-08 14:41
from django.conf import settings
from django.db import migrations, models
@ -21,18 +21,18 @@ class Migration(migrations.Migration):
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=40)),
('description', models.TextField(max_length=512)),
('category', models.CharField(choices=[('Glassware', 'Glassware'), ('Miscellaneous', 'Miscellaneous')], default='Miscellaneous', max_length=20)),
('description', models.TextField(max_length=512, null=True)),
('date_added', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
('last_updated', models.DateTimeField(auto_now=True)),
('category', models.CharField(choices=[('PC', 'PC'), ('NETWORKING', 'Networking'), ('CCTV', 'CCTV'), ('FURNITURE', 'Furniture'), ('PERIPHERALS', 'Peripherals'), ('MISC', 'Miscellaneous')], default='MISC', max_length=20)),
],
),
migrations.CreateModel(
name='HistoricalEquipmentInstance',
fields=[
('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('status', models.CharField(choices=[('WORKING', 'Working'), ('BROKEN', 'Broken'), ('MAINTENANCE', 'Under Maintenance'), ('DECOMISSIONED', 'Decomissioned')], default='PENDING', max_length=20)),
('remarks', models.TextField(max_length=512)),
('status', models.CharField(choices=[('Working', 'Working'), ('Broken', 'Broken'), ('Borrowed', 'Borrowed')], default='PENDING', max_length=20)),
('remarks', models.TextField(max_length=512, null=True)),
('date_added', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
('last_updated', models.DateTimeField(blank=True, editable=False)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
@ -55,10 +55,10 @@ class Migration(migrations.Migration):
fields=[
('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('name', models.CharField(max_length=40)),
('description', models.TextField(max_length=512)),
('category', models.CharField(choices=[('Glassware', 'Glassware'), ('Miscellaneous', 'Miscellaneous')], default='Miscellaneous', max_length=20)),
('description', models.TextField(max_length=512, null=True)),
('date_added', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
('last_updated', models.DateTimeField(blank=True, editable=False)),
('category', models.CharField(choices=[('PC', 'PC'), ('NETWORKING', 'Networking'), ('CCTV', 'CCTV'), ('FURNITURE', 'Furniture'), ('PERIPHERALS', 'Peripherals'), ('MISC', 'Miscellaneous')], default='MISC', max_length=20)),
('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)),
@ -77,8 +77,8 @@ class Migration(migrations.Migration):
name='EquipmentInstance',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('status', models.CharField(choices=[('WORKING', 'Working'), ('BROKEN', 'Broken'), ('MAINTENANCE', 'Under Maintenance'), ('DECOMISSIONED', 'Decomissioned')], default='PENDING', max_length=20)),
('remarks', models.TextField(max_length=512)),
('status', models.CharField(choices=[('Working', 'Working'), ('Broken', 'Broken'), ('Borrowed', 'Borrowed')], default='PENDING', max_length=20)),
('remarks', models.TextField(max_length=512, null=True)),
('date_added', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
('last_updated', models.DateTimeField(auto_now=True)),
('equipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='equipments.equipment')),

View file

@ -1,33 +0,0 @@
# Generated by Django 4.2.7 on 2023-12-02 13:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('equipments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='equipment',
name='description',
field=models.TextField(max_length=512, null=True),
),
migrations.AlterField(
model_name='equipmentinstance',
name='remarks',
field=models.TextField(max_length=512, null=True),
),
migrations.AlterField(
model_name='historicalequipment',
name='description',
field=models.TextField(max_length=512, null=True),
),
migrations.AlterField(
model_name='historicalequipmentinstance',
name='remarks',
field=models.TextField(max_length=512, null=True),
),
]