-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Skaar, Bjørn-Andre
committed
Dec 15, 2023
1 parent
f6311e8
commit 865b131
Showing
22 changed files
with
66 additions
and
73 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
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
2 changes: 1 addition & 1 deletion
2
klass-shared/src/main/resources/db/migration/V10__drop_column_in_correspondencetable.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 @@ | ||
ALTER TABLE correspondence_table DROP FOREIGN KEY fk_4tx0j45sopr6yj8wcedohj9w3; | ||
ALTER TABLE correspondence_table DROP CONSTRAINT fk_4tx0j45sopr6yj8wcedohj9w3; | ||
ALTER TABLE correspondence_table DROP COLUMN statistical_classification; |
2 changes: 1 addition & 1 deletion
2
klass-shared/src/main/resources/db/migration/V12__increase_column_size.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 @@ | ||
-- Migrating classifications from Stabas requires some increased column sizes | ||
ALTER TABLE classification_item MODIFY official_name VARCHAR(2048); | ||
ALTER TABLE classification_item ALTER COLUMN official_name VARCHAR(2048); |
12 changes: 6 additions & 6 deletions
12
klass-shared/src/main/resources/db/migration/V16__correspondencetable_uses_level_numbers.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,15 +1,15 @@ | ||
-- CorrespondenceTables stores level number instead of a foreign key to level | ||
ALTER TABLE correspondence_table DROP FOREIGN KEY fk_cqdqwek3akelq2qqnhuydrkqr; | ||
ALTER TABLE correspondence_table DROP FOREIGN KEY fk_8bn11tm1gsou84v8kmoug6qyt; | ||
ALTER TABLE correspondence_table DROP CONSTRAINT fk_cqdqwek3akelq2qqnhuydrkqr; | ||
ALTER TABLE correspondence_table DROP CONSTRAINT fk_8bn11tm1gsou84v8kmoug6qyt; | ||
|
||
UPDATE correspondence_table ct SET ct.source_level_id = | ||
COALESCE((SELECT l.level_number FROM level l WHERE l.id = ct.source_level_id), 0); | ||
|
||
UPDATE correspondence_table ct SET ct.target_level_id = | ||
COALESCE((SELECT l.level_number FROM level l WHERE l.id = ct.target_level_id), 0); | ||
|
||
ALTER TABLE correspondence_table CHANGE source_level_id source_level_number BIGINT; | ||
ALTER TABLE correspondence_table CHANGE target_level_id target_level_number BIGINT; | ||
ALTER TABLE correspondence_table ALTER COLUMN source_level_id RENAME TO source_level_number; | ||
ALTER TABLE correspondence_table ALTER COLUMN target_level_id RENAME TO target_level_number; | ||
|
||
ALTER TABLE correspondence_table MODIFY source_level_number INTEGER NOT NULL; | ||
ALTER TABLE correspondence_table MODIFY target_level_number INTEGER NOT NULL; | ||
ALTER TABLE correspondence_table ALTER COLUMN source_level_number INTEGER NOT NULL; | ||
ALTER TABLE correspondence_table ALTER COLUMN target_level_number INTEGER NOT NULL; |
4 changes: 2 additions & 2 deletions
4
klass-shared/src/main/resources/db/migration/V17__adding_phonenumber_and_email_to_users.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 @@ | ||
ALTER TABLE user ADD email VARCHAR(255) NULL; | ||
ALTER TABLE user ADD phone VARCHAR(255) NULL; | ||
ALTER TABLE "user" ADD email VARCHAR(255) NULL; | ||
ALTER TABLE "user" ADD phone VARCHAR(255) NULL; |
2 changes: 1 addition & 1 deletion
2
klass-shared/src/main/resources/db/migration/V18__subscription_verify_column.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 +1 @@ | ||
ALTER TABLE subscription MODIFY verification VARCHAR(255) NOT NULL; | ||
ALTER TABLE subscription ALTER COLUMN verification VARCHAR(255) NOT NULL; |
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
klass-shared/src/main/resources/db/migration/V20__adding_hierachy_timstamp.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,3 +1,3 @@ | ||
ALTER TABLE classification_series ADD hierarchy_last_modified DATETIME NULL; | ||
UPDATE classification_series SET hierarchy_last_modified = last_modified; | ||
ALTER TABLE classification_series MODIFY hierarchy_last_modified DATETIME NOT NULL; | ||
ALTER TABLE classification_series ALTER COLUMN hierarchy_last_modified DATETIME NOT NULL; |
8 changes: 4 additions & 4 deletions
8
...ed/src/main/resources/db/migration/V24__resizing_fields_to_make_room_for_longer_names.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,8 +1,8 @@ | ||
-- due to row limits of 65535 we need to reduce size for some fields to be able to increase name field | ||
-- reduce | ||
ALTER TABLE statistical_classification MODIFY valid_from VARCHAR(16); | ||
ALTER TABLE statistical_classification MODIFY valid_to VARCHAR(16); | ||
ALTER TABLE statistical_classification MODIFY uuid VARCHAR(64) NOT NULL; | ||
ALTER TABLE statistical_classification ALTER COLUMN valid_from VARCHAR(16); | ||
ALTER TABLE statistical_classification ALTER COLUMN valid_to VARCHAR(16); | ||
ALTER TABLE statistical_classification ALTER COLUMN uuid VARCHAR(64) NOT NULL; | ||
|
||
-- increase | ||
ALTER TABLE statistical_classification MODIFY name VARCHAR(1000); | ||
ALTER TABLE statistical_classification ALTER COLUMN name VARCHAR(1000); |
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
6 changes: 3 additions & 3 deletions
6
klass-shared/src/main/resources/db/migration/V27__change_varchar_to_text.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,4 +1,4 @@ | ||
ALTER TABLE correspondence_table MODIFY description TEXT NOT NULL; | ||
ALTER TABLE classification_series MODIFY description TEXT NOT NULL; | ||
ALTER TABLE statistical_classification MODIFY introduction TEXT NOT NULL; | ||
ALTER TABLE correspondence_table ALTER COLUMN description TEXT NOT NULL; | ||
ALTER TABLE classification_series ALTER COLUMN description TEXT NOT NULL; | ||
ALTER TABLE statistical_classification ALTER COLUMN introduction TEXT NOT NULL; | ||
|
6 changes: 4 additions & 2 deletions
6
...red/src/main/resources/db/migration/V2__statisticalclassification_level_bidirectional.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
6 changes: 4 additions & 2 deletions
6
...c/main/resources/db/migration/V3__correspondencetable_correspondencemap_bidirectional.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
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
4 changes: 2 additions & 2 deletions
4
klass-shared/src/main/resources/db/migration/V7__remove_constraints_classificationitem.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,3 +1,3 @@ | ||
-- Removed not null constraint since a ReferencingClassificationItem does not have these set | ||
ALTER TABLE classification_item MODIFY code VARCHAR(255); | ||
ALTER TABLE classification_item MODIFY official_name VARCHAR(1024); | ||
ALTER TABLE classification_item ALTER COLUMN code VARCHAR(255); | ||
ALTER TABLE classification_item ALTER COLUMN official_name VARCHAR(1024); |
14 changes: 7 additions & 7 deletions
14
klass-shared/src/main/resources/db/migration/V9__increase_column_sizes.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,11 +1,11 @@ | ||
-- Migrating classifications from Stabas requires some increased column sizes | ||
ALTER TABLE classification_item MODIFY notes VARCHAR(6000); | ||
ALTER TABLE classification_item ALTER COLUMN notes VARCHAR(6000); | ||
|
||
ALTER TABLE statistical_classification MODIFY introduction VARCHAR(7168) not null; | ||
ALTER TABLE statistical_classification MODIFY legal_base VARCHAR(4000); | ||
ALTER TABLE statistical_classification MODIFY publications VARCHAR(4000); | ||
ALTER TABLE statistical_classification MODIFY derived_from VARCHAR(4000); | ||
ALTER TABLE statistical_classification ALTER COLUMN introduction VARCHAR(7168) not null; | ||
ALTER TABLE statistical_classification ALTER COLUMN legal_base VARCHAR(4000); | ||
ALTER TABLE statistical_classification ALTER COLUMN publications VARCHAR(4000); | ||
ALTER TABLE statistical_classification ALTER COLUMN derived_from VARCHAR(4000); | ||
|
||
ALTER TABLE correspondence_table MODIFY description VARCHAR(4000) not null; | ||
ALTER TABLE correspondence_table ALTER COLUMN description VARCHAR(4000) not null; | ||
|
||
ALTER TABLE level MODIFY name VARCHAR(1000) not null; | ||
ALTER TABLE level ALTER COLUMN name VARCHAR(1000) not null; |
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