Skip to content

Commit b081369

Browse files
authored
Merge pull request #192 from brain-image-library/master
Master
2 parents 3a7bdaf + 6bcf66b commit b081369

23 files changed

+311
-68
lines changed

ingest/migrations/0001_raw.sql

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
BEGIN;
2+
--
3+
-- Create model Collection
4+
-- ** This Table Already Exists LPT **
5+
--CREATE TABLE "ingest_collection" ("id" serial NOT NULL PRIMARY KEY, "name" varchar(256) NOT NULL UNIQUE, "description" text NOT NULL, "organization_name" varchar(256) NOT NULL, "lab_name" varchar(256) NOT NULL, "project_funder_id" varchar(256) NOT NULL, "project_funder" varchar(256) NOT NULL, "modality" varchar(256) NOT NULL, "bil_uuid" varchar(256) NOT NULL, "data_path" varchar(256) NOT NULL, "locked" boolean NOT NULL, "celery_task_id_submission" varchar(256) NOT NULL, "celery_task_id_validation" varchar(256) NOT NULL, "submission_status" varchar(256) NOT NULL, "validation_status" varchar(256) NOT NULL, "collection_type" varchar(256) NOT NULL);
6+
--
7+
-- Create model Funder
8+
--
9+
CREATE TABLE "ingest_funder" ("id" serial NOT NULL PRIMARY KEY, "name" varchar(256) NOT NULL, "funding_reference_identifier" varchar(256) NOT NULL, "funding_reference_identifier_type" varchar(256) NOT NULL, "award_number" varchar(256) NOT NULL, "award_title" varchar(256) NOT NULL, "grant_number" varchar(256) NOT NULL);
10+
--
11+
-- Create model People
12+
--
13+
CREATE TABLE "ingest_people" ("id" serial NOT NULL PRIMARY KEY, "name" varchar(256) NOT NULL, "orcid" varchar(256) NOT NULL, "affiliation" varchar(256) NOT NULL, "affiliation_identifier" varchar(256) NOT NULL, "auth_user_id_id" integer NULL);
14+
--
15+
-- Create model Project
16+
--
17+
CREATE TABLE "ingest_project" ("id" serial NOT NULL PRIMARY KEY, "funded_by" varchar(256) NOT NULL, "is_biccn" boolean NOT NULL);
18+
--
19+
-- Create model UUID
20+
-- ** This Table Already Exists for some reason (not being used) LPT **
21+
--CREATE TABLE "ingest_uuid" ("id" serial NOT NULL PRIMARY KEY, "useduuid" varchar(256) NOT NULL UNIQUE);
22+
--
23+
-- Create model ProjectPeople
24+
--
25+
CREATE TABLE "ingest_projectpeople" ("id" serial NOT NULL PRIMARY KEY, "is_pi" boolean NOT NULL, "is_po" boolean NOT NULL, "doi_role" varchar(256) NOT NULL, "people_id_id" integer NULL, "project_id_id" integer NULL);
26+
--
27+
-- Create model ProjectFunders
28+
--
29+
CREATE TABLE "ingest_projectfunders" ("id" serial NOT NULL PRIMARY KEY, "funder_id_id" integer NULL, "project_id_id" integer NULL);
30+
--
31+
-- Create model ImageMetadata
32+
-- ** This Table Already Exists LPT **
33+
--CREATE TABLE "ingest_imagemetadata" ("id" serial NOT NULL PRIMARY KEY, "project_name" varchar(256) NOT NULL, "project_description" text NOT NULL, "background_strain" varchar(256) NOT NULL, "image_filename_pattern" varchar(256) NOT NULL, "directory" varchar(4096) NOT NULL, "locked" boolean NOT NULL, "date_created" timestamp with time zone NOT NULL, "last_edited" timestamp with time zone NOT NULL, "taxonomy_name" varchar(256) NOT NULL, "transgenic_line_name" varchar(256) NOT NULL, "age" integer NULL, "age_unit" varchar(256) NOT NULL, "sex" varchar(256) NOT NULL, "organ" varchar(256) NOT NULL, "organ_substructure" varchar(256) NOT NULL, "assay" varchar(256) NOT NULL, "slicing_direction" varchar(256) NOT NULL, "image_map_style" varchar(256) NOT NULL, "processing_level" varchar(256) NOT NULL, "collection_id" integer NOT NULL, "user_id" integer NULL);
34+
--
35+
-- Create model EventsLog
36+
--
37+
CREATE TABLE "ingest_eventslog" ("id" serial NOT NULL PRIMARY KEY, "notes" varchar(256) NOT NULL, "timestamp" timestamp with time zone NOT NULL, "event_type" varchar(64) NOT NULL, "collection_id_id" integer NULL, "people_id_id" integer NULL, "project_id_id" integer NULL);
38+
--
39+
-- Create model DescriptiveMetadata
40+
-- ** This Table Already Exists LPT **
41+
--CREATE TABLE "ingest_descriptivemetadata" ("id" serial NOT NULL PRIMARY KEY, "locked" boolean NOT NULL, "date_created" timestamp with time zone NOT NULL, "last_edited" timestamp with time zone NOT NULL, "sample_id" varchar(256) NOT NULL, "organism_type" varchar(256) NOT NULL, "organism_ncbi_taxonomy_id" varchar(256) NOT NULL, "transgenetic_line_information" varchar(256) NOT NULL, "modality" varchar(256) NULL, "method" varchar(256) NOT NULL, "technique" varchar(256) NOT NULL, "anatomical_structure" varchar(256) NOT NULL, "total_processed_cells" varchar(256) NOT NULL, "organization" varchar(256) NOT NULL, "lab" varchar(256) NOT NULL, "investigator" varchar(256) NOT NULL, "grant_number" varchar(256) NOT NULL, "dataset_uuid" varchar(256) NULL, "r24_name" varchar(256) NOT NULL, "r24_directory" varchar(256) NOT NULL, "collection_id" integer NOT NULL, "user_id" integer NULL);
42+
--
43+
-- Create model CollectionGroup
44+
--
45+
CREATE TABLE "ingest_collectiongroup" ("id" serial NOT NULL PRIMARY KEY, "name" varchar(256) NOT NULL, "project_id_id" integer NULL);
46+
--
47+
-- Add field collection_group_id to collection
48+
--
49+
ALTER TABLE "ingest_collection" ADD COLUMN "collection_group_id_id" integer NULL CONSTRAINT "ingest_collection_collection_group_id__a639afc4_fk_ingest_co" REFERENCES "ingest_collectiongroup"("id") DEFERRABLE INITIALLY DEFERRED; SET CONSTRAINTS "ingest_collection_collection_group_id__a639afc4_fk_ingest_co" IMMEDIATE;
50+
--
51+
-- Add field user to collection
52+
--
53+
ALTER TABLE "ingest_collection" ADD COLUMN "user_id" integer NULL CONSTRAINT "ingest_collection_user_id_09908d0f_fk_auth_user_id" REFERENCES "auth_user"("id") DEFERRABLE INITIALLY DEFERRED; SET CONSTRAINTS "ingest_collection_user_id_09908d0f_fk_auth_user_id" IMMEDIATE;
54+
CREATE INDEX "ingest_collection_name_ce993f04_like" ON "ingest_collection" ("name" varchar_pattern_ops);
55+
ALTER TABLE "ingest_people" ADD CONSTRAINT "ingest_people_auth_user_id_id_af2ebed4_fk_auth_user_id" FOREIGN KEY ("auth_user_id_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
56+
CREATE INDEX "ingest_people_auth_user_id_id_af2ebed4" ON "ingest_people" ("auth_user_id_id");
57+
CREATE INDEX "ingest_uuid_useduuid_2ceca877_like" ON "ingest_uuid" ("useduuid" varchar_pattern_ops);
58+
ALTER TABLE "ingest_projectpeople" ADD CONSTRAINT "ingest_projectpeople_people_id_id_1267e62e_fk_ingest_people_id" FOREIGN KEY ("people_id_id") REFERENCES "ingest_people" ("id") DEFERRABLE INITIALLY DEFERRED;
59+
ALTER TABLE "ingest_projectpeople" ADD CONSTRAINT "ingest_projectpeople_project_id_id_45236d01_fk_ingest_pr" FOREIGN KEY ("project_id_id") REFERENCES "ingest_project" ("id") DEFERRABLE INITIALLY DEFERRED;
60+
CREATE INDEX "ingest_projectpeople_people_id_id_1267e62e" ON "ingest_projectpeople" ("people_id_id");
61+
CREATE INDEX "ingest_projectpeople_project_id_id_45236d01" ON "ingest_projectpeople" ("project_id_id");
62+
ALTER TABLE "ingest_projectfunders" ADD CONSTRAINT "ingest_projectfunders_funder_id_id_f6e4421c_fk_ingest_funder_id" FOREIGN KEY ("funder_id_id") REFERENCES "ingest_funder" ("id") DEFERRABLE INITIALLY DEFERRED;
63+
ALTER TABLE "ingest_projectfunders" ADD CONSTRAINT "ingest_projectfunder_project_id_id_e9670b35_fk_ingest_pr" FOREIGN KEY ("project_id_id") REFERENCES "ingest_project" ("id") DEFERRABLE INITIALLY DEFERRED;
64+
CREATE INDEX "ingest_projectfunders_funder_id_id_f6e4421c" ON "ingest_projectfunders" ("funder_id_id");
65+
CREATE INDEX "ingest_projectfunders_project_id_id_e9670b35" ON "ingest_projectfunders" ("project_id_id");
66+
ALTER TABLE "ingest_imagemetadata" ADD CONSTRAINT "ingest_imagemetadata_collection_id_36dc62ee_fk_ingest_co" FOREIGN KEY ("collection_id") REFERENCES "ingest_collection" ("id") DEFERRABLE INITIALLY DEFERRED;
67+
ALTER TABLE "ingest_imagemetadata" ADD CONSTRAINT "ingest_imagemetadata_user_id_bfbf7eaf_fk_auth_user_id" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
68+
CREATE INDEX "ingest_imagemetadata_collection_id_36dc62ee" ON "ingest_imagemetadata" ("collection_id");
69+
CREATE INDEX "ingest_imagemetadata_user_id_bfbf7eaf" ON "ingest_imagemetadata" ("user_id");
70+
ALTER TABLE "ingest_eventslog" ADD CONSTRAINT "ingest_eventslog_collection_id_id_9da5c007_fk_ingest_co" FOREIGN KEY ("collection_id_id") REFERENCES "ingest_collection" ("id") DEFERRABLE INITIALLY DEFERRED;
71+
ALTER TABLE "ingest_eventslog" ADD CONSTRAINT "ingest_eventslog_people_id_id_38b2340f_fk_ingest_people_id" FOREIGN KEY ("people_id_id") REFERENCES "ingest_people" ("id") DEFERRABLE INITIALLY DEFERRED;
72+
ALTER TABLE "ingest_eventslog" ADD CONSTRAINT "ingest_eventslog_project_id_id_3cc0901c_fk_ingest_project_id" FOREIGN KEY ("project_id_id") REFERENCES "ingest_project" ("id") DEFERRABLE INITIALLY DEFERRED;
73+
CREATE INDEX "ingest_eventslog_collection_id_id_9da5c007" ON "ingest_eventslog" ("collection_id_id");
74+
CREATE INDEX "ingest_eventslog_people_id_id_38b2340f" ON "ingest_eventslog" ("people_id_id");
75+
CREATE INDEX "ingest_eventslog_project_id_id_3cc0901c" ON "ingest_eventslog" ("project_id_id");
76+
ALTER TABLE "ingest_descriptivemetadata" ADD CONSTRAINT "ingest_descriptiveme_collection_id_4c5f96f3_fk_ingest_co" FOREIGN KEY ("collection_id") REFERENCES "ingest_collection" ("id") DEFERRABLE INITIALLY DEFERRED;
77+
ALTER TABLE "ingest_descriptivemetadata" ADD CONSTRAINT "ingest_descriptivemetadata_user_id_7f0b3940_fk_auth_user_id" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
78+
CREATE INDEX "ingest_descriptivemetadata_collection_id_4c5f96f3" ON "ingest_descriptivemetadata" ("collection_id");
79+
CREATE INDEX "ingest_descriptivemetadata_user_id_7f0b3940" ON "ingest_descriptivemetadata" ("user_id");
80+
ALTER TABLE "ingest_collectiongroup" ADD CONSTRAINT "ingest_collectiongro_project_id_id_86a64d1a_fk_ingest_pr" FOREIGN KEY ("project_id_id") REFERENCES "ingest_project" ("id") DEFERRABLE INITIALLY DEFERRED;
81+
CREATE INDEX "ingest_collectiongroup_project_id_id_86a64d1a" ON "ingest_collectiongroup" ("project_id_id");
82+
CREATE INDEX "ingest_collection_collection_group_id_id_a639afc4" ON "ingest_collection" ("collection_group_id_id");
83+
CREATE INDEX "ingest_collection_user_id_09908d0f" ON "ingest_collection" ("user_id");
84+
ROLLBACK;
85+
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Generated by Django 3.2.13 on 2022-04-26 15:46
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('ingest', '0008_dataset_specimen_ingest_method_4'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='collection',
15+
name='id',
16+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
17+
),
18+
migrations.AlterField(
19+
model_name='contributor',
20+
name='id',
21+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
22+
),
23+
migrations.AlterField(
24+
model_name='datagroup',
25+
name='id',
26+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
27+
),
28+
migrations.AlterField(
29+
model_name='dataset',
30+
name='id',
31+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
32+
),
33+
migrations.AlterField(
34+
model_name='datastate',
35+
name='id',
36+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
37+
),
38+
migrations.AlterField(
39+
model_name='descriptivemetadata',
40+
name='id',
41+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
42+
),
43+
migrations.AlterField(
44+
model_name='eventslog',
45+
name='event_type',
46+
field=models.CharField(choices=[('mail_tapes_to_bil', 'Mail Tapes To BIL'), ('tapes_received', 'Tapes Received'), ('tapes_ready_for_qc', 'Tapes Ready For QC'), ('move_to_collection', 'Move To Collection'), ('request_brainball', 'Request Brainball'), ('Mail_brainball_from_bil', 'Mail Brainball From BIL'), ('mail_brainball_to_bil', 'Mail Brainball To BIL'), ('received_brainball', 'Received Brainball'), ('collection_created', 'Collection Created'), ('metadata_uploaded', 'Metadata Uploaded'), ('request_validation', 'Request Validation'), ('request_submission', 'Request Submission'), ('request_embargo', 'Request Embargo'), ('collection_public', 'Collection Public'), ('request_withdrawal', 'Request Withdrawal'), ('data_curated', 'Data Curated'), ('collection_validated', 'Collected Validated'), ('user_action_required', 'User Action Required')], default='', max_length=64),
47+
),
48+
migrations.AlterField(
49+
model_name='eventslog',
50+
name='id',
51+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
52+
),
53+
migrations.AlterField(
54+
model_name='funder',
55+
name='id',
56+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
57+
),
58+
migrations.AlterField(
59+
model_name='image',
60+
name='id',
61+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
62+
),
63+
migrations.AlterField(
64+
model_name='imagemetadata',
65+
name='id',
66+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
67+
),
68+
migrations.AlterField(
69+
model_name='instrument',
70+
name='id',
71+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
72+
),
73+
migrations.AlterField(
74+
model_name='people',
75+
name='id',
76+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
77+
),
78+
migrations.AlterField(
79+
model_name='project',
80+
name='id',
81+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
82+
),
83+
migrations.AlterField(
84+
model_name='projectfunders',
85+
name='id',
86+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
87+
),
88+
migrations.AlterField(
89+
model_name='projectpeople',
90+
name='id',
91+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
92+
),
93+
migrations.AlterField(
94+
model_name='publication',
95+
name='id',
96+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
97+
),
98+
migrations.AlterField(
99+
model_name='sheet',
100+
name='id',
101+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
102+
),
103+
migrations.AlterField(
104+
model_name='specimen',
105+
name='id',
106+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
107+
),
108+
migrations.AlterField(
109+
model_name='uuid',
110+
name='id',
111+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
112+
),
113+
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generated by Django 3.2.13 on 2022-04-26 16:08
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('ingest', '0009_auto_20220426_1546'),
10+
]
11+
12+
operations = [
13+
migrations.DeleteModel(
14+
name='ProjectFunders',
15+
),
16+
]
6.2 KB
Binary file not shown.
6.62 KB
Binary file not shown.
956 Bytes
Binary file not shown.
940 Bytes
Binary file not shown.
582 Bytes
Binary file not shown.
570 Bytes
Binary file not shown.
4.91 KB
Binary file not shown.

0 commit comments

Comments
 (0)