From 751a4291abe7b9c1c4eaf905990984d90f8ab985 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 10:05:17 +0200 Subject: [PATCH] We are in production, then we commit migrations --- .gitignore | 3 - apps/activity/migrations/0001_initial.py | 69 ++++++ .../migrations/0002_auto_20200904_2341.py | 89 ++++++++ apps/logs/migrations/0001_initial.py | 37 ++++ apps/member/migrations/0001_initial.py | 76 +++++++ .../migrations/0002_auto_20200904_2341.py | 42 ++++ apps/note/migrations/0001_initial.py | 209 ++++++++++++++++++ apps/permission/migrations/0001_initial.py | 71 ++++++ apps/treasury/migrations/0001_initial.py | 107 +++++++++ apps/wei/migrations/0001_initial.py | 120 ++++++++++ 10 files changed, 820 insertions(+), 3 deletions(-) create mode 100644 apps/activity/migrations/0001_initial.py create mode 100644 apps/activity/migrations/0002_auto_20200904_2341.py create mode 100644 apps/logs/migrations/0001_initial.py create mode 100644 apps/member/migrations/0001_initial.py create mode 100644 apps/member/migrations/0002_auto_20200904_2341.py create mode 100644 apps/note/migrations/0001_initial.py create mode 100644 apps/permission/migrations/0001_initial.py create mode 100644 apps/treasury/migrations/0001_initial.py create mode 100644 apps/wei/migrations/0001_initial.py diff --git a/.gitignore b/.gitignore index 94433be1..f541ab85 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,3 @@ backups/ env/ venv/ db.sqlite3 - -# Ignore migrations during first phase dev -migrations/ diff --git a/apps/activity/migrations/0001_initial.py b/apps/activity/migrations/0001_initial.py new file mode 100644 index 00000000..ba2d68da --- /dev/null +++ b/apps/activity/migrations/0001_initial.py @@ -0,0 +1,69 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Activity', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, verbose_name='name')), + ('description', models.TextField(verbose_name='description')), + ('location', models.CharField(blank=True, default='', help_text='Place where the activity is organized, eg. Kfet.', max_length=255, verbose_name='location')), + ('date_start', models.DateTimeField(verbose_name='start date')), + ('date_end', models.DateTimeField(verbose_name='end date')), + ('valid', models.BooleanField(default=False, verbose_name='valid')), + ('open', models.BooleanField(default=False, verbose_name='open')), + ], + options={ + 'verbose_name': 'activity', + 'verbose_name_plural': 'activities', + }, + ), + migrations.CreateModel( + name='ActivityType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, verbose_name='name')), + ('manage_entries', models.BooleanField(default=False, help_text='Enable the support of entries for this activity.', verbose_name='manage entries')), + ('can_invite', models.BooleanField(default=False, verbose_name='can invite')), + ('guest_entry_fee', models.PositiveIntegerField(default=0, verbose_name='guest entry fee')), + ], + options={ + 'verbose_name': 'activity type', + 'verbose_name_plural': 'activity types', + }, + ), + migrations.CreateModel( + name='Entry', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='entry time')), + ], + options={ + 'verbose_name': 'entry', + 'verbose_name_plural': 'entries', + }, + ), + migrations.CreateModel( + name='Guest', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('last_name', models.CharField(max_length=255, verbose_name='last name')), + ('first_name', models.CharField(max_length=255, verbose_name='first name')), + ], + options={ + 'verbose_name': 'guest', + 'verbose_name_plural': 'guests', + }, + ), + ] diff --git a/apps/activity/migrations/0002_auto_20200904_2341.py b/apps/activity/migrations/0002_auto_20200904_2341.py new file mode 100644 index 00000000..4afa74dd --- /dev/null +++ b/apps/activity/migrations/0002_auto_20200904_2341.py @@ -0,0 +1,89 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('activity', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('member', '0001_initial'), + ('note', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='GuestTransaction', + fields=[ + ('transaction_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Transaction')), + ('entry', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='activity.Entry')), + ], + options={ + 'abstract': False, + 'base_manager_name': 'objects', + }, + bases=('note.transaction',), + ), + migrations.AddField( + model_name='guest', + name='activity', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='activity.Activity'), + ), + migrations.AddField( + model_name='guest', + name='inviter', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='guests', to='note.NoteUser', verbose_name='inviter'), + ), + migrations.AddField( + model_name='entry', + name='activity', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='entries', to='activity.Activity', verbose_name='activity'), + ), + migrations.AddField( + model_name='entry', + name='guest', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='activity.Guest'), + ), + migrations.AddField( + model_name='entry', + name='note', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='note.NoteUser', verbose_name='note'), + ), + migrations.AddField( + model_name='activity', + name='activity_type', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='activity.ActivityType', verbose_name='type'), + ), + migrations.AddField( + model_name='activity', + name='attendees_club', + field=models.ForeignKey(help_text='Club that is authorized to join the activity. Mostly the Kfet club.', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='member.Club', verbose_name='attendees club'), + ), + migrations.AddField( + model_name='activity', + name='creater', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='user'), + ), + migrations.AddField( + model_name='activity', + name='organizer', + field=models.ForeignKey(help_text='Club that organizes the activity. The entry fees will go to this club.', on_delete=django.db.models.deletion.PROTECT, related_name='+', to='member.Club', verbose_name='organizer'), + ), + migrations.AlterUniqueTogether( + name='guest', + unique_together={('activity', 'last_name', 'first_name')}, + ), + migrations.AlterUniqueTogether( + name='entry', + unique_together={('activity', 'note', 'guest')}, + ), + migrations.AlterUniqueTogether( + name='activity', + unique_together={('name', 'date_start', 'date_end')}, + ), + ] diff --git a/apps/logs/migrations/0001_initial.py b/apps/logs/migrations/0001_initial.py new file mode 100644 index 00000000..e517edfb --- /dev/null +++ b/apps/logs/migrations/0001_initial.py @@ -0,0 +1,37 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('contenttypes', '0002_remove_content_type_name'), + ] + + operations = [ + migrations.CreateModel( + name='Changelog', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('ip', models.GenericIPAddressField(blank=True, null=True, verbose_name='IP Address')), + ('instance_pk', models.CharField(max_length=255, verbose_name='identifier')), + ('previous', models.TextField(null=True, verbose_name='previous data')), + ('data', models.TextField(null=True, verbose_name='new data')), + ('action', models.CharField(choices=[('create', 'create'), ('edit', 'edit'), ('delete', 'delete')], default='edit', max_length=16, verbose_name='action')), + ('timestamp', models.DateTimeField(default=django.utils.timezone.now, verbose_name='timestamp')), + ('model', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.ContentType', verbose_name='model')), + ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='user')), + ], + options={ + 'verbose_name': 'changelog', + 'verbose_name_plural': 'changelogs', + }, + ), + ] diff --git a/apps/member/migrations/0001_initial.py b/apps/member/migrations/0001_initial.py new file mode 100644 index 00000000..be357568 --- /dev/null +++ b/apps/member/migrations/0001_initial.py @@ -0,0 +1,76 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +import datetime +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import phonenumber_field.modelfields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Club', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True, verbose_name='name')), + ('email', models.EmailField(max_length=254, verbose_name='email')), + ('require_memberships', models.BooleanField(default=True, help_text="Uncheck if this club don't require memberships.", verbose_name='require memberships')), + ('membership_fee_paid', models.PositiveIntegerField(default=0, verbose_name='membership fee (paid students)')), + ('membership_fee_unpaid', models.PositiveIntegerField(default=0, verbose_name='membership fee (unpaid students)')), + ('membership_duration', models.PositiveIntegerField(blank=True, help_text='The longest time (in days) a membership can last (NULL = infinite).', null=True, verbose_name='membership duration')), + ('membership_start', models.DateField(blank=True, help_text='Date from which the members can renew their membership.', null=True, verbose_name='membership start')), + ('membership_end', models.DateField(blank=True, help_text='Maximal date of a membership, after which members must renew it.', null=True, verbose_name='membership end')), + ], + options={ + 'verbose_name': 'club', + 'verbose_name_plural': 'clubs', + }, + ), + migrations.CreateModel( + name='Profile', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('phone_number', phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=50, null=True, region=None, verbose_name='phone number')), + ('section', models.CharField(blank=True, help_text='e.g. "1A0", "9A♥", "SAPHIRE"', max_length=255, null=True, verbose_name='section')), + ('department', models.CharField(choices=[('A0', 'Informatics (A0)'), ('A1', 'Mathematics (A1)'), ('A2', 'Physics (A2)'), ("A'2", "Applied physics (A'2)"), ('A2', "Chemistry (A''2)"), ('A3', 'Biology (A3)'), ('B1234', 'SAPHIRE (B1234)'), ('B1', 'Mechanics (B1)'), ('B2', 'Civil engineering (B2)'), ('B3', 'Mechanical engineering (B3)'), ('B4', 'EEA (B4)'), ('C', 'Design (C)'), ('D2', 'Economy-management (D2)'), ('D3', 'Social sciences (D3)'), ('E', 'English (E)'), ('EXT', 'External (EXT)')], max_length=8, verbose_name='department')), + ('promotion', models.PositiveSmallIntegerField(default=2020, help_text='Year of entry to the school (None if not ENS student)', null=True, verbose_name='promotion')), + ('address', models.CharField(blank=True, max_length=255, null=True, verbose_name='address')), + ('paid', models.BooleanField(default=False, help_text='Tells if the user receive a salary.', verbose_name='paid')), + ('ml_events_registration', models.CharField(blank=True, choices=[(None, 'No'), ('fr', 'Yes (receive them in french)'), ('en', 'Yes (receive them in english)')], default=None, max_length=2, null=True, verbose_name='Register on the mailing list to stay informed of the events of the campus (1 mail/week)')), + ('ml_sport_registration', models.BooleanField(default=False, verbose_name='Register on the mailing list to stay informed of the sport events of the campus (1 mail/week)')), + ('ml_art_registration', models.BooleanField(default=False, verbose_name='Register on the mailing list to stay informed of the art events of the campus (1 mail/week)')), + ('report_frequency', models.PositiveSmallIntegerField(default=0, verbose_name='report frequency (in days)')), + ('last_report', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last report date')), + ('email_confirmed', models.BooleanField(default=False, verbose_name='email confirmed')), + ('registration_valid', models.BooleanField(default=False, verbose_name='registration valid')), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'user profile', + 'verbose_name_plural': 'user profile', + }, + ), + migrations.CreateModel( + name='Membership', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date_start', models.DateField(default=datetime.date.today, verbose_name='membership starts on')), + ('date_end', models.DateField(null=True, verbose_name='membership ends on')), + ('fee', models.PositiveIntegerField(verbose_name='fee')), + ('club', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='member.Club', verbose_name='club')), + ], + options={ + 'verbose_name': 'membership', + 'verbose_name_plural': 'memberships', + }, + ), + ] diff --git a/apps/member/migrations/0002_auto_20200904_2341.py b/apps/member/migrations/0002_auto_20200904_2341.py new file mode 100644 index 00000000..3dd9d045 --- /dev/null +++ b/apps/member/migrations/0002_auto_20200904_2341.py @@ -0,0 +1,42 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('permission', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('member', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='membership', + name='roles', + field=models.ManyToManyField(to='permission.Role', verbose_name='roles'), + ), + migrations.AddField( + model_name='membership', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='memberships', to=settings.AUTH_USER_MODEL, verbose_name='user'), + ), + migrations.AddField( + model_name='club', + name='parent_club', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='member.Club', verbose_name='parent club'), + ), + migrations.AddIndex( + model_name='profile', + index=models.Index(fields=['user'], name='member_prof_user_id_30c316_idx'), + ), + migrations.AddIndex( + model_name='membership', + index=models.Index(fields=['user'], name='member_memb_user_id_945dbc_idx'), + ), + ] diff --git a/apps/note/migrations/0001_initial.py b/apps/note/migrations/0001_initial.py new file mode 100644 index 00000000..a0ebda31 --- /dev/null +++ b/apps/note/migrations/0001_initial.py @@ -0,0 +1,209 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('member', '0001_initial'), + ('contenttypes', '0002_remove_content_type_name'), + ] + + operations = [ + migrations.CreateModel( + name='Note', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('balance', models.BigIntegerField(default=0, help_text='in centimes, money credited for this instance', verbose_name='account balance')), + ('last_negative', models.DateTimeField(blank=True, help_text='last time the balance was negative', null=True, verbose_name='last negative date')), + ('display_image', models.ImageField(default='pic/default.png', max_length=255, upload_to='pic/', verbose_name='display image')), + ('created_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='created at')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this note should be treated as active. Unselect this instead of deleting notes.', verbose_name='active')), + ('inactivity_reason', models.CharField(choices=[('manual', 'The user blocked his/her note manually, eg. when he/she left the school for holidays. It can be reactivated at any time.'), ('forced', "The note is blocked by the the BDE and can't be manually reactivated.")], default=None, max_length=255, null=True)), + ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_note.note_set+', to='contenttypes.ContentType')), + ], + options={ + 'verbose_name': 'note', + 'verbose_name_plural': 'notes', + }, + ), + migrations.CreateModel( + name='TemplateCategory', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=31, unique=True, verbose_name='name')), + ], + options={ + 'verbose_name': 'transaction category', + 'verbose_name_plural': 'transaction categories', + }, + ), + migrations.CreateModel( + name='Transaction', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('source_alias', models.CharField(default='', max_length=255, verbose_name='used alias')), + ('destination_alias', models.CharField(default='', max_length=255, verbose_name='used alias')), + ('created_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='created at')), + ('quantity', models.PositiveIntegerField(default=1, verbose_name='quantity')), + ('amount', models.PositiveIntegerField(verbose_name='amount')), + ('reason', models.CharField(max_length=255, verbose_name='reason')), + ('valid', models.BooleanField(default=True, verbose_name='valid')), + ('invalidity_reason', models.CharField(blank=True, default=None, max_length=255, null=True, verbose_name='invalidity reason')), + ('destination', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='note.Note', verbose_name='destination')), + ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_note.transaction_set+', to='contenttypes.ContentType')), + ('source', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='note.Note', verbose_name='source')), + ], + options={ + 'verbose_name': 'transaction', + 'verbose_name_plural': 'transactions', + }, + ), + migrations.CreateModel( + name='MembershipTransaction', + fields=[ + ('transaction_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Transaction')), + ], + options={ + 'verbose_name': 'membership transaction', + 'verbose_name_plural': 'membership transactions', + }, + bases=('note.transaction',), + ), + migrations.CreateModel( + name='NoteClub', + fields=[ + ('note_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Note')), + ], + options={ + 'verbose_name': 'club note', + 'verbose_name_plural': 'clubs notes', + }, + bases=('note.note',), + ), + migrations.CreateModel( + name='NoteSpecial', + fields=[ + ('note_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Note')), + ('special_type', models.CharField(max_length=255, unique=True, verbose_name='type')), + ], + options={ + 'verbose_name': 'special note', + 'verbose_name_plural': 'special notes', + }, + bases=('note.note',), + ), + migrations.CreateModel( + name='NoteUser', + fields=[ + ('note_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Note')), + ], + options={ + 'verbose_name': "one's note", + 'verbose_name_plural': 'users note', + }, + bases=('note.note',), + ), + migrations.CreateModel( + name='RecurrentTransaction', + fields=[ + ('transaction_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Transaction')), + ], + options={ + 'verbose_name': 'recurrent transaction', + 'verbose_name_plural': 'recurrent transactions', + }, + bases=('note.transaction',), + ), + migrations.CreateModel( + name='SpecialTransaction', + fields=[ + ('transaction_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Transaction')), + ('last_name', models.CharField(max_length=255, verbose_name='name')), + ('first_name', models.CharField(max_length=255, verbose_name='first_name')), + ('bank', models.CharField(blank=True, max_length=255, verbose_name='bank')), + ], + options={ + 'verbose_name': 'Special transaction', + 'verbose_name_plural': 'Special transactions', + }, + bases=('note.transaction',), + ), + migrations.CreateModel( + name='Alias', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True, verbose_name='name')), + ('normalized_name', models.CharField(editable=False, max_length=255, unique=True)), + ('note', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='note.Note')), + ], + options={ + 'verbose_name': 'alias', + 'verbose_name_plural': 'aliases', + }, + ), + migrations.CreateModel( + name='TransactionTemplate', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(error_messages={'unique': 'A template with this name already exist'}, max_length=255, unique=True, verbose_name='name')), + ('amount', models.PositiveIntegerField(verbose_name='amount')), + ('display', models.BooleanField(default=True, verbose_name='display')), + ('highlighted', models.BooleanField(default=False, verbose_name='highlighted')), + ('description', models.CharField(blank=True, max_length=255, verbose_name='description')), + ('category', models.ForeignKey(max_length=31, on_delete=django.db.models.deletion.PROTECT, related_name='templates', to='note.TemplateCategory', verbose_name='type')), + ('destination', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='note.NoteClub', verbose_name='destination')), + ], + options={ + 'verbose_name': 'transaction template', + 'verbose_name_plural': 'transaction templates', + }, + ), + migrations.AddIndex( + model_name='transaction', + index=models.Index(fields=['created_at'], name='note_transa_created_bea8b1_idx'), + ), + migrations.AddIndex( + model_name='transaction', + index=models.Index(fields=['source'], name='note_transa_source__4a1a1e_idx'), + ), + migrations.AddIndex( + model_name='transaction', + index=models.Index(fields=['destination'], name='note_transa_destina_6e1bb4_idx'), + ), + migrations.AddField( + model_name='recurrenttransaction', + name='template', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='note.TransactionTemplate'), + ), + migrations.AddField( + model_name='noteuser', + name='user', + field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='note', to=settings.AUTH_USER_MODEL, verbose_name='user'), + ), + migrations.AddField( + model_name='noteclub', + name='club', + field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='note', to='member.Club', verbose_name='club'), + ), + migrations.AddField( + model_name='membershiptransaction', + name='membership', + field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='transaction', to='member.Membership'), + ), + migrations.AddIndex( + model_name='alias', + index=models.Index(fields=['name'], name='note_alias_name_a89405_idx'), + ), + migrations.AddIndex( + model_name='alias', + index=models.Index(fields=['normalized_name'], name='note_alias_normali_bd52b4_idx'), + ), + ] diff --git a/apps/permission/migrations/0001_initial.py b/apps/permission/migrations/0001_initial.py new file mode 100644 index 00000000..c82aa032 --- /dev/null +++ b/apps/permission/migrations/0001_initial.py @@ -0,0 +1,71 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('member', '0001_initial'), + ('contenttypes', '0002_remove_content_type_name'), + ] + + operations = [ + migrations.CreateModel( + name='Permission', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('query', models.TextField(verbose_name='query')), + ('type', models.CharField(choices=[('add', 'add'), ('view', 'view'), ('change', 'change'), ('delete', 'delete')], max_length=15, verbose_name='type')), + ('field', models.CharField(blank=True, max_length=255, verbose_name='field')), + ('permanent', models.BooleanField(default=False, help_text='Tells if the permission should be granted even if the membership of the user is expired.', verbose_name='permanent')), + ('description', models.CharField(blank=True, max_length=255, verbose_name='description')), + ], + options={ + 'verbose_name': 'permission', + 'verbose_name_plural': 'permissions', + }, + ), + migrations.CreateModel( + name='PermissionMask', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('rank', models.PositiveSmallIntegerField(unique=True, verbose_name='rank')), + ('description', models.CharField(max_length=255, unique=True, verbose_name='description')), + ], + options={ + 'verbose_name': 'permission mask', + 'verbose_name_plural': 'permission masks', + }, + ), + migrations.CreateModel( + name='Role', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, verbose_name='name')), + ('for_club', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.PROTECT, to='member.Club', verbose_name='for club')), + ('permissions', models.ManyToManyField(to='permission.Permission', verbose_name='permissions')), + ], + options={ + 'verbose_name': 'role permissions', + 'verbose_name_plural': 'role permissions', + }, + ), + migrations.AddField( + model_name='permission', + name='mask', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='permissions', to='permission.PermissionMask', verbose_name='mask'), + ), + migrations.AddField( + model_name='permission', + name='model', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.ContentType', verbose_name='model'), + ), + migrations.AlterUniqueTogether( + name='permission', + unique_together={('model', 'query', 'type', 'field')}, + ), + ] diff --git a/apps/treasury/migrations/0001_initial.py b/apps/treasury/migrations/0001_initial.py new file mode 100644 index 00000000..0231d293 --- /dev/null +++ b/apps/treasury/migrations/0001_initial.py @@ -0,0 +1,107 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +import datetime +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('note', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Invoice', + fields=[ + ('id', models.PositiveIntegerField(primary_key=True, serialize=False, verbose_name='Invoice identifier')), + ('bde', models.CharField(choices=[('Saperlistpopette.png', 'Saper[list]popette'), ('Finalist.png', 'Fina[list]'), ('Listorique.png', '[List]orique'), ('Satellist.png', 'Satel[list]'), ('Monopolist.png', 'Monopo[list]'), ('Kataclist.png', 'Katac[list]')], default='Saperlistpopette.png', max_length=32, verbose_name='BDE')), + ('object', models.CharField(max_length=255, verbose_name='Object')), + ('description', models.TextField(verbose_name='Description')), + ('name', models.CharField(max_length=255, verbose_name='Name')), + ('address', models.TextField(verbose_name='Address')), + ('date', models.DateField(default=datetime.date.today, verbose_name='Date')), + ('acquitted', models.BooleanField(default=False, verbose_name='Acquitted')), + ('locked', models.BooleanField(default=False, help_text="An invoice can't be edited when it is locked.", verbose_name='Locked')), + ('tex', models.TextField(default='', verbose_name='tex source')), + ], + options={ + 'verbose_name': 'invoice', + 'verbose_name_plural': 'invoices', + }, + ), + migrations.CreateModel( + name='Remittance', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date')), + ('comment', models.CharField(max_length=255, verbose_name='Comment')), + ('closed', models.BooleanField(default=False, verbose_name='Closed')), + ], + options={ + 'verbose_name': 'remittance', + 'verbose_name_plural': 'remittances', + }, + ), + migrations.CreateModel( + name='SpecialTransactionProxy', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('remittance', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='treasury.Remittance', verbose_name='Remittance')), + ('transaction', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='note.SpecialTransaction')), + ], + options={ + 'verbose_name': 'special transaction proxy', + 'verbose_name_plural': 'special transaction proxies', + }, + ), + migrations.CreateModel( + name='SogeCredit', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('credit_transaction', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to='note.SpecialTransaction', verbose_name='credit transaction')), + ('transactions', models.ManyToManyField(related_name='_sogecredit_transactions_+', to='note.MembershipTransaction', verbose_name='membership transactions')), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='user')), + ], + options={ + 'verbose_name': 'Credit from the Société générale', + 'verbose_name_plural': 'Credits from the Société générale', + }, + ), + migrations.CreateModel( + name='RemittanceType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('note', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='note.NoteSpecial')), + ], + options={ + 'verbose_name': 'remittance type', + 'verbose_name_plural': 'remittance types', + }, + ), + migrations.AddField( + model_name='remittance', + name='remittance_type', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='treasury.RemittanceType', verbose_name='Type'), + ), + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('designation', models.CharField(max_length=255, verbose_name='Designation')), + ('quantity', models.PositiveIntegerField(verbose_name='Quantity')), + ('amount', models.IntegerField(verbose_name='Unit price')), + ('invoice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='treasury.Invoice', verbose_name='invoice')), + ], + options={ + 'verbose_name': 'product', + 'verbose_name_plural': 'products', + }, + ), + ] diff --git a/apps/wei/migrations/0001_initial.py b/apps/wei/migrations/0001_initial.py new file mode 100644 index 00000000..0ad73fab --- /dev/null +++ b/apps/wei/migrations/0001_initial.py @@ -0,0 +1,120 @@ +# Generated by Django 2.2.16 on 2020-09-04 21:41 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import phonenumber_field.modelfields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('permission', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('member', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Bus', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, verbose_name='name')), + ('description', models.TextField(blank=True, default='', verbose_name='description')), + ('information_json', models.TextField(default='{}', help_text='Information about the survey for new members, encoded in JSON', verbose_name='survey information')), + ], + options={ + 'verbose_name': 'Bus', + 'verbose_name_plural': 'Buses', + }, + ), + migrations.CreateModel( + name='BusTeam', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, verbose_name='name')), + ('color', models.PositiveIntegerField(help_text='The color of the T-Shirt, stored with its number equivalent', verbose_name='color')), + ('description', models.TextField(blank=True, default='', verbose_name='description')), + ('bus', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='teams', to='wei.Bus', verbose_name='bus')), + ], + options={ + 'verbose_name': 'Bus team', + 'verbose_name_plural': 'Bus teams', + 'unique_together': {('bus', 'name')}, + }, + ), + migrations.CreateModel( + name='WEIClub', + fields=[ + ('club_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='member.Club')), + ('year', models.PositiveIntegerField(default=2020, unique=True, verbose_name='year')), + ('date_start', models.DateField(verbose_name='date start')), + ('date_end', models.DateField(verbose_name='date end')), + ], + options={ + 'verbose_name': 'WEI', + 'verbose_name_plural': 'WEI', + }, + bases=('member.club',), + ), + migrations.CreateModel( + name='WEIRole', + fields=[ + ('role_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='permission.Role')), + ], + options={ + 'verbose_name': 'WEI Role', + 'verbose_name_plural': 'WEI Roles', + }, + bases=('permission.role',), + ), + migrations.CreateModel( + name='WEIRegistration', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('soge_credit', models.BooleanField(default=False, verbose_name='Credit from Société générale')), + ('caution_check', models.BooleanField(default=False, verbose_name='Caution check given')), + ('birth_date', models.DateField(verbose_name='birth date')), + ('gender', models.CharField(choices=[('male', 'Male'), ('female', 'Female'), ('nonbinary', 'Non binary')], max_length=16, verbose_name='gender')), + ('clothing_cut', models.CharField(choices=[('male', 'Male'), ('female', 'Female')], max_length=16, verbose_name='clothing cut')), + ('clothing_size', models.CharField(choices=[('XS', 'XS'), ('S', 'S'), ('M', 'M'), ('L', 'L'), ('XL', 'XL'), ('XXL', 'XXL')], max_length=4, verbose_name='clothing size')), + ('health_issues', models.TextField(blank=True, default='', verbose_name='health issues')), + ('emergency_contact_name', models.CharField(max_length=255, verbose_name='emergency contact name')), + ('emergency_contact_phone', phonenumber_field.modelfields.PhoneNumberField(max_length=32, region=None, verbose_name='emergency contact phone')), + ('first_year', models.BooleanField(default=False, help_text='Tells if the user is new in the school.', verbose_name='first year')), + ('information_json', models.TextField(default='{}', help_text='Information about the registration (buses for old members, survey fot the new members), encoded in JSON', verbose_name='registration information')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='wei', to=settings.AUTH_USER_MODEL, verbose_name='user')), + ('wei', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='users', to='wei.WEIClub', verbose_name='WEI')), + ], + options={ + 'verbose_name': 'WEI User', + 'verbose_name_plural': 'WEI Users', + 'unique_together': {('user', 'wei')}, + }, + ), + migrations.CreateModel( + name='WEIMembership', + fields=[ + ('membership_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='member.Membership')), + ('bus', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='memberships', to='wei.Bus', verbose_name='bus')), + ('registration', models.OneToOneField(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='membership', to='wei.WEIRegistration', verbose_name='WEI registration')), + ('team', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='memberships', to='wei.BusTeam', verbose_name='team')), + ], + options={ + 'verbose_name': 'WEI membership', + 'verbose_name_plural': 'WEI memberships', + }, + bases=('member.membership',), + ), + migrations.AddField( + model_name='bus', + name='wei', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='buses', to='wei.WEIClub', verbose_name='WEI'), + ), + migrations.AlterUniqueTogether( + name='bus', + unique_together={('wei', 'name')}, + ), + ]