SQUASHING
This commit is contained in:
parent
8573b0326b
commit
a541a6f301
42 changed files with 588 additions and 1001 deletions
77
ccdb/projects/migrations/0001_initial.py
Normal file
77
ccdb/projects/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,77 @@
|
|||
from django.db import migrations, models
|
||||
import autoslug.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Project',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('code', models.CharField(blank=True, max_length=10)),
|
||||
('iacuc_number', models.CharField(blank=True, max_length=25)),
|
||||
('description', models.CharField(blank=True, max_length=255)),
|
||||
('sort_order', models.IntegerField(blank=True, null=True)),
|
||||
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['sort_order'],
|
||||
},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='project',
|
||||
unique_together=set([('name', 'code')]),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Grant',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('code', models.CharField(blank=True, max_length=10)),
|
||||
('description', models.CharField(blank=True, max_length=255)),
|
||||
('sort_order', models.IntegerField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['sort_order'],
|
||||
},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='grant',
|
||||
unique_together=set([('title', 'code')]),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='grant',
|
||||
name='projects',
|
||||
field=models.ManyToManyField(related_name='grants', to='projects.Project'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='GrantReport',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('report_type', models.CharField(blank=True, max_length=50)),
|
||||
('description', models.CharField(blank=True, max_length=255)),
|
||||
('due_date', models.DateField(blank=True, null=True)),
|
||||
('submitted_date', models.DateField(blank=True, null=True)),
|
||||
('attachment', models.FileField(blank=True, null=True, upload_to='projects/grants/grant_report_attachments/%Y/%m/%d')),
|
||||
('sort_order', models.IntegerField(blank=True, null=True)),
|
||||
('grant', models.ForeignKey(to='projects.Grant')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['sort_order'],
|
||||
},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='grantreport',
|
||||
unique_together=set([('grant', 'title', 'due_date')]),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='grantreport',
|
||||
name='grant',
|
||||
field=models.ForeignKey(related_name='reports', to='projects.Grant'),
|
||||
),
|
||||
]
|
|
@ -1,33 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import autoslug.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Project',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('code', models.CharField(max_length=10, blank=True)),
|
||||
('iacuc_number', models.CharField(max_length=25, blank=True)),
|
||||
('description', models.CharField(max_length=255, blank=True)),
|
||||
('sort_order', models.IntegerField(null=True, blank=True)),
|
||||
('slug', autoslug.fields.AutoSlugField(populate_from='name', editable=False)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['sort_order'],
|
||||
},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='project',
|
||||
unique_together=set([('name', 'code')]),
|
||||
),
|
||||
]
|
|
@ -8,7 +8,6 @@ class Migration(migrations.Migration):
|
|||
def migrate(apps, schema_editor):
|
||||
sources = get_data_sources()
|
||||
if not sources:
|
||||
print('no sources')
|
||||
return
|
||||
|
||||
c = sources['db0']
|
||||
|
@ -75,7 +74,7 @@ class Migration(migrations.Migration):
|
|||
model.objects.all().delete()
|
||||
|
||||
dependencies = [
|
||||
('projects', '0004_initial_grantreport'),
|
||||
('projects', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
|
@ -1,31 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0001_initial_project'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Grant',
|
||||
fields=[
|
||||
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('code', models.CharField(max_length=10, blank=True)),
|
||||
('description', models.CharField(max_length=255, blank=True)),
|
||||
('sort_order', models.IntegerField(null=True, blank=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['sort_order'],
|
||||
},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='grant',
|
||||
unique_together=set([('title', 'code')]),
|
||||
),
|
||||
]
|
|
@ -1,19 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0002_initial_grant'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='grant',
|
||||
name='projects',
|
||||
field=models.ManyToManyField(to='projects.Project', related_name='grants'),
|
||||
),
|
||||
]
|
|
@ -1,35 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0003_grant_projects'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='GrantReport',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('report_type', models.CharField(max_length=50, blank=True)),
|
||||
('description', models.CharField(max_length=255, blank=True)),
|
||||
('due_date', models.DateField(blank=True, null=True)),
|
||||
('submitted_date', models.DateField(blank=True, null=True)),
|
||||
('attachment', models.FileField(upload_to='projects/grants/grant_report_attachments/%Y/%m/%d', blank=True, null=True)),
|
||||
('sort_order', models.IntegerField(blank=True, null=True)),
|
||||
('grant', models.ForeignKey(to='projects.Grant')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['sort_order'],
|
||||
},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='grantreport',
|
||||
unique_together=set([('grant', 'title', 'due_date')]),
|
||||
),
|
||||
]
|
|
@ -1,19 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0005_DATA_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='grantreport',
|
||||
name='grant',
|
||||
field=models.ForeignKey(to='projects.Grant', related_name='reports'),
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue