]> git.parisson.com Git - teleforma.git/commitdiff
Recreating table payment so FK are correct
authorGael Le Mignot <gael@pilotsystems.net>
Mon, 15 May 2023 08:54:07 +0000 (10:54 +0200)
committerGael Le Mignot <gael@pilotsystems.net>
Mon, 15 May 2023 08:54:07 +0000 (10:54 +0200)
teleforma/migrations/0003_delete_payment.py [new file with mode: 0644]
teleforma/migrations/0004_payment.py [new file with mode: 0644]

diff --git a/teleforma/migrations/0003_delete_payment.py b/teleforma/migrations/0003_delete_payment.py
new file mode 100644 (file)
index 0000000..c8e8449
--- /dev/null
@@ -0,0 +1,16 @@
+# Generated by Django 3.2.13 on 2023-05-15 10:49
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('teleforma', '0002_chatmessage_notification'),
+    ]
+
+    operations = [
+        migrations.DeleteModel(
+            name='Payment',
+        ),
+    ]
diff --git a/teleforma/migrations/0004_payment.py b/teleforma/migrations/0004_payment.py
new file mode 100644 (file)
index 0000000..3acd476
--- /dev/null
@@ -0,0 +1,35 @@
+# Generated by Django 3.2.13 on 2023-05-15 10:49
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('teleforma', '0003_delete_payment'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Payment',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('value', models.FloatField(help_text='€', verbose_name='amount')),
+                ('month', models.IntegerField(blank=True, choices=[(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], default=1, null=True, verbose_name='month')),
+                ('type', models.CharField(choices=[('online', 'en ligne'), ('check', 'par chèque'), ('tranfer', 'par virement'), ('credit card', 'par carte'), ('money', 'en liquide'), ('other', 'autre')], default='online', max_length=64, verbose_name='payment type')),
+                ('date_created', models.DateTimeField(auto_now_add=True, verbose_name='date created')),
+                ('date_modified', models.DateTimeField(auto_now=True, verbose_name='date modified')),
+                ('scheduled', models.DateField(blank=True, null=True, verbose_name="date d'échéance")),
+                ('online_paid', models.BooleanField(blank=True, help_text='paiement en ligne uniquement', verbose_name='payé')),
+                ('date_paid', models.DateField(blank=True, null=True, verbose_name='date de paiement')),
+                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='teleforma.student', verbose_name='student')),
+            ],
+            options={
+                'verbose_name': 'Payment',
+                'verbose_name_plural': 'Payments',
+                'db_table': 'teleforma_payments',
+                'ordering': ['scheduled', 'month'],
+            },
+        ),
+    ]