-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
up sampled_indivuals_taxa and replacing taxons with taxa
- Loading branch information
Showing
10 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
web/backend/migrations/2024-01-24-233039_create_samples_table/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
web/backend/migrations/2024-01-24-233853_create_taxons_table/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
-- This file should undo anything in `up.sql` | ||
DROP TABLE IF EXISTS taxons; | ||
DROP TABLE IF EXISTS taxa; |
2 changes: 1 addition & 1 deletion
2
web/backend/migrations/2024-01-24-233853_create_taxons_table/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
web/backend/migrations/2024-02-12-155504_create_sample_taxa_table/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- This file should undo anything in `up.sql` |
11 changes: 11 additions & 0 deletions
11
web/backend/migrations/2024-02-12-155504_create_sample_taxa_table/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Your SQL goes here | ||
-- A migration to create the sample_taxa table. | ||
-- This is a N to M relationship between samples and taxa. | ||
-- A sample can be associated to no or more taxa, and a taxon can be found in multiple samples. | ||
-- | ||
CREATE TABLE sample_taxa ( | ||
sample_id INTEGER NOT NULL REFERENCES samples(id) ON DELETE CASCADE, | ||
taxon_id INTEGER NOT NULL REFERENCES taxa(id) ON DELETE CASCADE, | ||
PRIMARY KEY (sample_id, taxon_id) | ||
); | ||
|
1 change: 1 addition & 0 deletions
1
web/backend/migrations/2024-02-12-155755_create_sampled_individual_taxa_table/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- This file should undo anything in `up.sql` |
11 changes: 11 additions & 0 deletions
11
web/backend/migrations/2024-02-12-155755_create_sampled_individual_taxa_table/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Your SQL goes here | ||
-- A migration to create the sampled_individual_taxa table. | ||
-- This is a N to M relationship between sampled_individuals and taxa. | ||
-- An individual can be associated to no or more taxa, and a taxon can be found in multiple individuals. | ||
-- | ||
CREATE TABLE sampled_individual_taxa ( | ||
sampled_individual_id INTEGER NOT NULL REFERENCES sampled_individuals(id) ON DELETE CASCADE, | ||
taxon_id INTEGER NOT NULL REFERENCES taxa(id) ON DELETE CASCADE, | ||
PRIMARY KEY (sampled_individual_id, taxon_id) | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters