-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DUOS-1760][risk=low] Create Dataset Joins Table (#1602)
* created changelog which creates the dar_dataset collection * remove console log * changed datasetid to dataset_id * added new line
- Loading branch information
1 parent
3de83ea
commit f5ab16b
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> | ||
<changeSet id="82.0" author="phendriksen"> | ||
<createTable tableName="dar_dataset"> | ||
<column name="dataset_id" type="bigint"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="reference_id" type="varchar(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
<addPrimaryKey | ||
columnNames="dataset_id, reference_id" | ||
constraintName="join_table_key" | ||
tableName="dar_dataset"/> | ||
<addForeignKeyConstraint baseColumnNames="dataset_id" baseTableName="dar_dataset" constraintName="fkDatasetId" | ||
deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" | ||
referencedColumnNames="datasetid" referencedTableName="dataset" | ||
referencesUniqueColumn="true"/> | ||
<addForeignKeyConstraint baseColumnNames="reference_id" baseTableName="dar_dataset" constraintName="fkReferenceId" | ||
deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" | ||
referencedColumnNames="reference_id" referencedTableName="data_access_request" | ||
referencesUniqueColumn="true"/> | ||
<rollback> | ||
<dropTable tableName="dar_dataset"/> | ||
<dropForeignKeyConstraint baseTableName="dar_dataset" constraintName="fkDatasetId"/> | ||
<dropForeignKeyConstraint baseTableName="dar_dataset" constraintName="fkReferenceId"/> | ||
</rollback> | ||
</changeSet> | ||
</databaseChangeLog> |