|
| 1 | +import django.core.validators |
| 2 | +import django.db.models.deletion |
| 3 | +import simple_history.models |
| 4 | +from django.conf import settings |
| 5 | +from django.db import migrations, models |
| 6 | + |
| 7 | + |
| 8 | +class Migration(migrations.Migration): |
| 9 | + |
| 10 | + dependencies = [ |
| 11 | + ('general', '0003_rename_institution_documentfile_institution_and_more'), |
| 12 | + migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
| 13 | + ] |
| 14 | + |
| 15 | + operations = [ |
| 16 | + migrations.CreateModel( |
| 17 | + name='HistoricalDocumentFile', |
| 18 | + fields=[ |
| 19 | + ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), |
| 20 | + ('title', models.CharField(max_length=200)), |
| 21 | + ('url', models.URLField(blank=True, verbose_name='URL')), |
| 22 | + ('uploaded_file', models.TextField(blank=True, help_text='PDF files up to 10MB are allowed.', max_length=100, validators=[django.core.validators.FileExtensionValidator(['pdf'])])), |
| 23 | + ('available', models.BooleanField(default=True)), |
| 24 | + ('license', models.CharField(choices=[('(c)', 'All rights reserved'), ('CC0', 'No rights reserved'), ('CC BY', 'Creative Commons Attribution'), ('CC BY-SA', 'Creative Commons Attribution-ShareAlike'), ('CC BY-NC', 'Creative Commons Attribution-NonCommercial'), ('CC BY-NC-SA', 'Creative Commons Attribution-NonCommercial-ShareAlike')], default='(c)', help_text='\n <a\n href="https://creativecommons.org/share-your-work/cclicenses/"\n rel="noreferrer"\n target="_blank"\n >\n More information about Creative Commons licenses.\n </a>\'\n ', max_length=200)), |
| 25 | + ('mime_type', models.CharField(blank=True, help_text='This input will auto-populate.', max_length=200)), |
| 26 | + ('document_type', models.CharField(choices=[('Glossary', 'Glossary'), ('Policy', 'Policy')], max_length=200)), |
| 27 | + ('history_id', models.AutoField(primary_key=True, serialize=False)), |
| 28 | + ('history_date', models.DateTimeField(db_index=True)), |
| 29 | + ('history_change_reason', models.CharField(max_length=100, null=True)), |
| 30 | + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), |
| 31 | + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), |
| 32 | + ('institution', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='general.institution')), |
| 33 | + ], |
| 34 | + options={ |
| 35 | + 'verbose_name': 'historical document file', |
| 36 | + 'verbose_name_plural': 'historical document files', |
| 37 | + 'ordering': ('-history_date', '-history_id'), |
| 38 | + 'get_latest_by': ('history_date', 'history_id'), |
| 39 | + }, |
| 40 | + bases=(simple_history.models.HistoricalChanges, models.Model), |
| 41 | + ), |
| 42 | + migrations.CreateModel( |
| 43 | + name='HistoricalInstitution', |
| 44 | + fields=[ |
| 45 | + ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), |
| 46 | + ('name', models.CharField(db_index=True, max_length=200)), |
| 47 | + ('abbreviation', models.CharField(max_length=200)), |
| 48 | + ('url', models.URLField(blank=True, verbose_name='URL')), |
| 49 | + ('email', models.EmailField(blank=True, max_length=200)), |
| 50 | + ('logo', models.TextField(blank=True, max_length=100)), |
| 51 | + ('history_id', models.AutoField(primary_key=True, serialize=False)), |
| 52 | + ('history_date', models.DateTimeField(db_index=True)), |
| 53 | + ('history_change_reason', models.CharField(max_length=100, null=True)), |
| 54 | + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), |
| 55 | + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), |
| 56 | + ], |
| 57 | + options={ |
| 58 | + 'verbose_name': 'historical institution', |
| 59 | + 'verbose_name_plural': 'historical institutions', |
| 60 | + 'ordering': ('-history_date', '-history_id'), |
| 61 | + 'get_latest_by': ('history_date', 'history_id'), |
| 62 | + }, |
| 63 | + bases=(simple_history.models.HistoricalChanges, models.Model), |
| 64 | + ), |
| 65 | + migrations.CreateModel( |
| 66 | + name='HistoricalLanguage', |
| 67 | + fields=[ |
| 68 | + ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), |
| 69 | + ('name', models.CharField(db_index=True, max_length=150)), |
| 70 | + ('iso_code', models.CharField(db_index=True, help_text='The 2 or 3 letter code from ISO 639.', max_length=50, verbose_name='ISO code')), |
| 71 | + ('history_id', models.AutoField(primary_key=True, serialize=False)), |
| 72 | + ('history_date', models.DateTimeField(db_index=True)), |
| 73 | + ('history_change_reason', models.CharField(max_length=100, null=True)), |
| 74 | + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), |
| 75 | + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), |
| 76 | + ], |
| 77 | + options={ |
| 78 | + 'verbose_name': 'historical language', |
| 79 | + 'verbose_name_plural': 'historical languages', |
| 80 | + 'ordering': ('-history_date', '-history_id'), |
| 81 | + 'get_latest_by': ('history_date', 'history_id'), |
| 82 | + }, |
| 83 | + bases=(simple_history.models.HistoricalChanges, models.Model), |
| 84 | + ), |
| 85 | + migrations.CreateModel( |
| 86 | + name='HistoricalProject', |
| 87 | + fields=[ |
| 88 | + ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), |
| 89 | + ('name', models.CharField(max_length=200)), |
| 90 | + ('url', models.URLField(blank=True, verbose_name='URL')), |
| 91 | + ('logo', models.TextField(blank=True, max_length=100)), |
| 92 | + ('start_date', models.DateField(blank=True, null=True)), |
| 93 | + ('end_date', models.DateField(blank=True, null=True)), |
| 94 | + ('history_id', models.AutoField(primary_key=True, serialize=False)), |
| 95 | + ('history_date', models.DateTimeField(db_index=True)), |
| 96 | + ('history_change_reason', models.CharField(max_length=100, null=True)), |
| 97 | + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), |
| 98 | + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), |
| 99 | + ('institution', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='general.institution', verbose_name='institution')), |
| 100 | + ], |
| 101 | + options={ |
| 102 | + 'verbose_name': 'historical project', |
| 103 | + 'verbose_name_plural': 'historical projects', |
| 104 | + 'ordering': ('-history_date', '-history_id'), |
| 105 | + 'get_latest_by': ('history_date', 'history_id'), |
| 106 | + }, |
| 107 | + bases=(simple_history.models.HistoricalChanges, models.Model), |
| 108 | + ), |
| 109 | + migrations.CreateModel( |
| 110 | + name='HistoricalSubject', |
| 111 | + fields=[ |
| 112 | + ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), |
| 113 | + ('name', models.CharField(db_index=True, max_length=150)), |
| 114 | + ('history_id', models.AutoField(primary_key=True, serialize=False)), |
| 115 | + ('history_date', models.DateTimeField(db_index=True)), |
| 116 | + ('history_change_reason', models.CharField(max_length=100, null=True)), |
| 117 | + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), |
| 118 | + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), |
| 119 | + ], |
| 120 | + options={ |
| 121 | + 'verbose_name': 'historical subject', |
| 122 | + 'verbose_name_plural': 'historical subjects', |
| 123 | + 'ordering': ('-history_date', '-history_id'), |
| 124 | + 'get_latest_by': ('history_date', 'history_id'), |
| 125 | + }, |
| 126 | + bases=(simple_history.models.HistoricalChanges, models.Model), |
| 127 | + ), |
| 128 | + ] |
0 commit comments