From da8822e8217ded2782aca3c6026e23c943ccaba5 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 15 Apr 2020 10:31:37 +0200 Subject: [PATCH] misc: restore initial 0001 migration (#39544) --- atreal_openads/migrations/0001_initial.py | 139 +++------------------- 1 file changed, 19 insertions(+), 120 deletions(-) diff --git a/atreal_openads/migrations/0001_initial.py b/atreal_openads/migrations/0001_initial.py index 2ac505a..fdcf165 100644 --- a/atreal_openads/migrations/0001_initial.py +++ b/atreal_openads/migrations/0001_initial.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.11.18 on 2019-08-22 16:28 +# Generated by Django 1.11.15 on 2019-04-30 12:07 from __future__ import unicode_literals -import atreal_openads.utils from django.db import migrations, models -import django.db.models.deletion +import jsonfield.fields +import passerelle.apps.atreal_openads.models class Migration(migrations.Migration): @@ -12,7 +12,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('base', '0013_delete_templatevar'), + ('base', '0012_job'), ] operations = [ @@ -23,131 +23,30 @@ class Migration(migrations.Migration): ('title', models.CharField(max_length=50, verbose_name='Title')), ('description', models.TextField(verbose_name='Description')), ('slug', models.SlugField(unique=True, verbose_name='Identifier')), - ('basic_auth_username', models.CharField(blank=True, max_length=128, verbose_name='Basic authentication username')), - ('basic_auth_password', models.CharField(blank=True, max_length=128, verbose_name='Basic authentication password')), - ('client_certificate', models.FileField(blank=True, null=True, upload_to='', verbose_name='TLS client certificate')), - ('trusted_certificate_authorities', models.FileField(blank=True, null=True, upload_to='', verbose_name='TLS trusted CAs')), - ('verify_cert', models.BooleanField(default=True, verbose_name='TLS verify certificates')), - ('http_proxy', models.CharField(blank=True, max_length=128, verbose_name='HTTP and HTTPS proxy')), - ('default_collectivite_openADS_id', models.PositiveIntegerField(blank=True, default=0, help_text='ex: 3', verbose_name="Default 'collectivite' (identifier in openADS)")), - ('openADS_API_url', models.URLField(default='', help_text='ex: https://openads.your_domain.net/api/', max_length=255, verbose_name='openADS API URL')), - ('users', models.ManyToManyField(blank=True, related_name='_atrealopenads_users_+', related_query_name='+', to='base.ApiUser')), + ('myjobs', jsonfield.fields.JSONField(default={})), + ('collectivite', models.CharField(blank=True, default=b'', help_text='ex: Marseille, ou ex: 3', max_length=255, verbose_name='Collectivity (identifier)')), + ('openADS_API_key', models.CharField(default=b'', help_text='ex: ah9pGbKKHv5ToF3cPQuV', max_length=255, verbose_name='openADS API key (secret)')), + ('openADS_API_url', models.URLField(default=b'', help_text='ex: https://openads.your_domain.net/api/', max_length=255, verbose_name='openADS API URL')), + ('users', models.ManyToManyField(blank=True, to='base.ApiUser')), ], options={ - 'ordering': ['openADS_API_url'], 'verbose_name': 'openADS', - 'verbose_name_plural': 'openADS', }, - bases=(models.Model, atreal_openads.utils.BaseModel), - ), - migrations.CreateModel( - name='Collectivite', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(blank=True, default='', max_length=150, verbose_name='Name')), - ('openADS_id', models.PositiveIntegerField(help_text='ex: 3', verbose_name='openADS identifier')), - ('connecteur', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='collectivites', related_query_name='collectivite', to='atreal_openads.AtrealOpenads')), - ], - options={ - 'ordering': ['name'], - 'verbose_name': 'Collectivite', - }, - bases=(models.Model, atreal_openads.utils.BaseModel), ), migrations.CreateModel( name='ForwardFile', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('numero_demande', models.CharField(max_length=20, verbose_name='Tracking code')), - ('numero_dossier', models.CharField(max_length=20, verbose_name='Numero dossier')), - ('type_fichier', models.CharField(max_length=10, verbose_name='Type')), - ('file_hash', models.CharField(blank=True, default='', max_length=100, verbose_name='Hash')), - ('orig_filename', models.CharField(blank=True, default='', max_length=100, verbose_name='Filename')), - ('content_type', models.CharField(blank=True, default='', max_length=100, verbose_name='Content type')), - ('size', models.PositiveIntegerField(default=0, verbose_name='Size')), - ('upload_file', models.FileField(blank=True, null=True, upload_to=atreal_openads.utils.get_upload_path, verbose_name='File')), - ('upload_attempt', models.PositiveIntegerField(blank=True, default=0, verbose_name='Upload attempt')), - ('upload_status', models.CharField(choices=[('pending', 'Pending'), ('uploading', 'Uploading'), ('failed', 'Failed'), ('success', 'Success')], default='pending', max_length=10, verbose_name='Upload status')), - ('upload_msg', models.CharField(blank=True, default='', max_length=255, verbose_name='Upload message')), - ('last_update_datetime', models.DateTimeField(auto_now=True, verbose_name='Last update')), - ('collectivite', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='forward_files', related_query_name='forward_file', to='atreal_openads.Collectivite')), - ('connecteur', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forward_files', related_query_name='forward_file', to='atreal_openads.AtrealOpenads')), + ('numero_demande', models.CharField(max_length=20)), + ('numero_dossier', models.CharField(max_length=20)), + ('type_fichier', models.CharField(max_length=10)), + ('file_hash', models.CharField(blank=True, default=b'', max_length=100)), + ('orig_filename', models.CharField(blank=True, default=b'', max_length=100)), + ('content_type', models.CharField(blank=True, default=b'', max_length=100)), + ('upload_file', models.FileField(null=True, upload_to=passerelle.apps.atreal_openads.models.get_upload_path)), + ('upload_status', models.CharField(blank=True, default=b'', max_length=10)), + ('upload_msg', models.CharField(blank=True, default=b'', max_length=255)), + ('last_update_datetime', models.DateTimeField(auto_now=True)), ], - options={ - 'ordering': ['-last_update_datetime'], - 'verbose_name': 'Forward File', - }, - bases=(models.Model, atreal_openads.utils.BaseModel), - ), - migrations.CreateModel( - name='Guichet', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('ouverture_jour_h', models.TimeField(help_text='ex: 08:30', verbose_name='Hour of opening (each day)')), - ('fermeture_jour_h', models.TimeField(help_text='ex: 17:00', verbose_name='Hour of closing (each day)')), - ('ouverture_sem_d', models.PositiveIntegerField(choices=[(1, 'Monday'), (2, 'Tuesday'), (3, 'Wednesday'), (4, 'Thursday'), (5, 'Friday'), (6, 'Saturday'), (7, 'Sunday')], default=1, help_text='ex: Lundi', verbose_name='Day of opening (each week)')), - ('fermeture_sem_d', models.PositiveIntegerField(choices=[(1, 'Monday'), (2, 'Tuesday'), (3, 'Wednesday'), (4, 'Thursday'), (5, 'Friday'), (6, 'Saturday'), (7, 'Sunday')], default=6, help_text='ex: Samedi', verbose_name='Day of closing (each week)')), - ('ouverture_sem_h', models.TimeField(help_text='ex: 08:30', verbose_name='Hour of opening (on opening day)')), - ('fermeture_sem_h', models.TimeField(help_text='ex: 12:15', verbose_name='Hour of closing (on closing day)')), - ('collectivite', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='guichet', to='atreal_openads.Collectivite')), - ], - options={ - 'ordering': ['collectivite'], - 'verbose_name': 'Guichet', - 'verbose_name_plural': 'Guichets', - }, - bases=(models.Model, atreal_openads.utils.BaseModel), - ), - migrations.AddIndex( - model_name='guichet', - index=models.Index(fields=['collectivite'], name='su_collectivite_idx'), - ), - migrations.AddIndex( - model_name='forwardfile', - index=models.Index(fields=['connecteur'], name='ff_connecteur_idx'), - ), - migrations.AddIndex( - model_name='forwardfile', - index=models.Index(fields=['collectivite'], name='ff_collectivite_idx'), - ), - migrations.AddIndex( - model_name='forwardfile', - index=models.Index(fields=['numero_demande', 'numero_dossier'], name='ff_deman_doss_idx'), - ), - migrations.AddIndex( - model_name='forwardfile', - index=models.Index(fields=['numero_demande'], name='ff_demande_idx'), - ), - migrations.AddIndex( - model_name='forwardfile', - index=models.Index(fields=['numero_dossier'], name='ff_dossier_idx'), - ), - migrations.AddIndex( - model_name='forwardfile', - index=models.Index(fields=['orig_filename'], name='ff_filename_idx'), - ), - migrations.AddIndex( - model_name='forwardfile', - index=models.Index(fields=['upload_status'], name='ff_status_idx'), - ), - migrations.AddIndex( - model_name='forwardfile', - index=models.Index(fields=['last_update_datetime'], name='ff_last_up_dt_idx'), - ), - migrations.AddIndex( - model_name='collectivite', - index=models.Index(fields=['connecteur', 'openADS_id'], name='col_conn_openADSid_idx'), - ), - migrations.AddIndex( - model_name='collectivite', - index=models.Index(fields=['connecteur'], name='col_connecteur_idx'), - ), - migrations.AddIndex( - model_name='collectivite', - index=models.Index(fields=['openADS_id'], name='col_openADS_id_idx'), - ), - migrations.AlterUniqueTogether( - name='collectivite', - unique_together=set([('connecteur', 'openADS_id')]), ), ]