-
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.
- Loading branch information
Showing
10 changed files
with
119 additions
and
161 deletions.
There are no files selected for viewing
40 changes: 22 additions & 18 deletions
40
database/migrations/sqls/20240529120605-pgwar-entity-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,25 +1,29 @@ | ||
-- Drop triggers | ||
---------------- | ||
DROP TRIGGER add_pgwar_entity_preview_partition ON projects.project; | ||
DROP TRIGGER after_upsert_resource ON information.resource; | ||
-- Revert trigger and trigger function for after_delete_resource | ||
------------------------------------------------------------- | ||
DROP TRIGGER after_delete_resource ON information.resource; | ||
|
||
-- Drop functions | ||
----------------- | ||
DROP FUNCTION pgwar.add_entity_preview_partition; | ||
DROP FUNCTION pgwar.upsert_entity_preview_fk_class; | ||
DROP FUNCTION pgwar.update_from_resource; | ||
DROP FUNCTION pgwar.after_upsert_resource; | ||
DROP FUNCTION pgwar.after_delete_resource; | ||
|
||
-- Drop partitions | ||
------------------ | ||
DROP TABLE pgwar.entity_preview_0; | ||
-- Revert triggers and trigger function for after_upsert_resource | ||
-------------------------------------------------------------- | ||
DROP TRIGGER after_update_resource ON information.resource; | ||
|
||
DROP TRIGGER after_insert_resource ON information.resource; | ||
|
||
DROP FUNCTION pgwar.after_upsert_resource; | ||
|
||
-- Revert function to update pgwar from resource | ||
---------------------------------------------- | ||
DROP FUNCTION pgwar.update_from_resource; | ||
|
||
-- Revert function to upsert fk_project, pk_entity, fk_class on pgwar.entity_preview | ||
----------------------------------------------------------------------------- | ||
DROP FUNCTION pgwar.upsert_entity_preview_fk_class; | ||
|
||
-- Drop tables | ||
-------------- | ||
-- Revert table pgwar.entity_preview | ||
------------------------------ | ||
DROP TABLE pgwar.entity_preview; | ||
|
||
-- Drop schema | ||
-------------- | ||
DROP SCHEMA pgwar; | ||
-- Revert schema pgwar | ||
------------------------------ | ||
DROP SCHEMA pgwar; |
44 changes: 18 additions & 26 deletions
44
database/migrations/sqls/20240606082339-pgwar-project-statements-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,29 +1,21 @@ | ||
-- Drop trigger after_delete_pgw_statement | ||
DROP TRIGGER after_delete_pgw_statement ON pgwar.statement; | ||
|
||
-- Drop function pgwar.after_delete_pgw_statement | ||
DROP FUNCTION pgwar.after_delete_pgw_statement; | ||
|
||
-- Drop trigger after_upsert_pgw_statement | ||
DROP TRIGGER after_upsert_pgw_statement ON pgwar.statement; | ||
|
||
-- Drop function pgwar.after_upsert_pgw_statement | ||
DROP FUNCTION pgwar.after_upsert_pgw_statement; | ||
|
||
-- Drop trigger after_modify_info_proj_rel | ||
-- Triggers | ||
---------------------------------------------- | ||
DROP TRIGGER after_modify_info_proj_rel ON projects.info_proj_rel; | ||
|
||
-- Drop function pgwar.after_modify_info_proj_rel | ||
DROP FUNCTION pgwar.after_modify_info_proj_rel; | ||
|
||
-- Drop function pgwar.update_from_info_proj_rel | ||
DROP FUNCTION pgwar.update_from_info_proj_rel; | ||
|
||
-- Drop function pgwar.upsert_project_statements | ||
DROP FUNCTION pgwar.upsert_project_statements; | ||
|
||
-- Drop trigger last_modification_tmsp on pgwar.project_statements | ||
DROP TRIGGER after_upsert_pgw_statement ON pgwar.statement; | ||
DROP TRIGGER after_delete_pgw_statement ON pgwar.statement; | ||
DROP TRIGGER last_modification_tmsp ON pgwar.project_statements; | ||
|
||
-- Drop table pgwar.project_statements | ||
DROP TRIGGER after_delete_project_statements ON pgwar.project_statements; | ||
|
||
-- Functions | ||
---------------------------------------------- | ||
DROP FUNCTION pgwar.after_modify_info_proj_rel(); | ||
DROP FUNCTION pgwar.update_from_info_proj_rel(projects.info_proj_rel, boolean); | ||
DROP FUNCTION pgwar.after_upsert_pgw_statement(); | ||
DROP FUNCTION pgwar.after_delete_pgw_statement(); | ||
DROP FUNCTION pgwar.handle_project_statements_delete(); | ||
DROP FUNCTION pgwar.upsert_project_statements(pgwar.project_statements); | ||
|
||
-- Tables | ||
---------------------------------------------- | ||
DROP TABLE pgwar.project_statements; | ||
DROP TABLE pgwar.project_statements_deleted; |
41 changes: 19 additions & 22 deletions
41
database/migrations/sqls/20240612071824-pgwar-fulltext-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,31 +1,28 @@ | ||
-- Drop triggers | ||
DROP TRIGGER after_delete_project_statements ON pgwar.project_statements; | ||
DROP TRIGGER last_modification_tmsp ON pgwar.entity_full_text; | ||
DROP TRIGGER after_upsert_entity_full_text ON pgwar.entity_full_text; | ||
|
||
-- Drop trigger functions | ||
DROP FUNCTION pgwar.handle_project_statements_delete; | ||
DROP FUNCTION pgwar.update_entity_preview_full_text; | ||
|
||
-- Drop functions | ||
DROP FUNCTION pgwar.get_label_of_outgoing_field; | ||
DROP FUNCTION pgwar.get_label_of_incoming_field; | ||
DROP FUNCTION pgwar.get_property_label; | ||
DROP FUNCTION pgwar.get_property_inverse_label; | ||
DROP FUNCTION pgwar.get_project_lang_code; | ||
DROP FUNCTION pgwar.get_project_full_text; | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_subjects_of_stmt; | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_objects_of_stmt; | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_subjects_of_stmt_del; | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_objects_of_stmt_del; | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_subjects_of_stmt_by_dfh_prop; | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_objects_of_stmt_by_dfh_prop; | ||
DROP FUNCTION pgwar.get_outdated_full_texts; | ||
DROP FUNCTION pgwar.update_full_texts; | ||
DROP FUNCTION pgwar.update_entity_preview_full_text(); | ||
DROP FUNCTION pgwar.update_full_texts(int); | ||
DROP FUNCTION pgwar.get_outdated_full_texts(int); | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_objects_of_stmt_by_dfh_prop(int); | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_subjects_of_stmt_by_dfh_prop(int); | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_objects_of_stmt_del(int); | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_subjects_of_stmt_del(int); | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_objects_of_stmt(int); | ||
DROP FUNCTION pgwar.get_outdated_full_texts_in_subjects_of_stmt(int); | ||
DROP FUNCTION pgwar.get_project_full_text(int, int); | ||
DROP FUNCTION pgwar.get_project_lang_code(int); | ||
DROP FUNCTION pgwar.get_property_inverse_label(int, text); | ||
DROP FUNCTION pgwar.get_property_label(int, text); | ||
DROP FUNCTION pgwar.get_label_of_incoming_field(int, int, int, int); | ||
DROP FUNCTION pgwar.get_label_of_outgoing_field(int, int, int, int); | ||
DROP FUNCTION pgwar.get_target_label_of_field(int, int, jsonb); | ||
DROP FUNCTION pgwar.get_target_labels_of_incoming_field(int, int, int, int); | ||
DROP FUNCTION pgwar.get_target_labels_of_outgoing_field(int, int, int, int); | ||
|
||
-- Drop tables | ||
DROP TABLE pgwar.project_statements_deleted; | ||
DROP TABLE pgwar.entity_full_text; | ||
|
||
-- Drop dblink extension | ||
-- Drop extension | ||
DROP EXTENSION dblink; |
69 changes: 38 additions & 31 deletions
69
database/migrations/sqls/20240612071825-pgwar-project-entity-labels-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,42 +1,49 @@ | ||
/*** | ||
* Drop Triggers | ||
***/ | ||
|
||
-- Drop trigger on pgwar.project_statements | ||
DROP TRIGGER on_modify_project_statement ON pgwar.project_statements; | ||
/** | ||
* Triggers | ||
**/ | ||
|
||
-- Drop triggers on pgwar.entity_preview | ||
DROP TRIGGER on_upsert_entity_preview_fk_class ON pgwar.entity_preview; | ||
DROP TRIGGER after_upsert_entity_preview_entity_label_01 ON pgwar.entity_preview; | ||
DROP TRIGGER after_insert_entity_preview ON pgwar.entity_preview; | ||
DROP TRIGGER after_update_entity_preview ON pgwar.entity_preview; | ||
DROP TRIGGER after_delete_entity_preview_01 ON pgwar.entity_preview; | ||
|
||
-- Drop trigger on projects.entity_label_config | ||
DROP TRIGGER after_insert_project_statement ON pgwar.project_statements; | ||
DROP TRIGGER after_update_project_statement ON pgwar.project_statements; | ||
DROP TRIGGER after_delete_project_statement ON pgwar.project_statements; | ||
DROP TRIGGER on_upsert_entity_label_config ON projects.entity_label_config; | ||
|
||
/*** | ||
* Drop Functions | ||
* Trigger Functions | ||
***/ | ||
|
||
-- Drop functions for label retrieval and update | ||
DROP FUNCTION pgwar.get_project_entity_label(entity_id int, project_id int); | ||
DROP FUNCTION pgwar.update_entity_label_of_entity_preview; | ||
DROP FUNCTION pgwar.get_and_update_project_entity_label; | ||
|
||
-- Drop functions for label calculation | ||
DROP FUNCTION pgwar.get_target_labels_of_incoming_field; | ||
DROP FUNCTION pgwar.get_target_labels_of_outgoing_field; | ||
DROP FUNCTION pgwar.get_target_label_of_field; | ||
|
||
-- Drop trigger functions for label update on changes | ||
DROP FUNCTION pgwar.update_entity_label_on_project_statement_change; | ||
DROP FUNCTION pgwar.update_entity_label_on_fk_class_change; | ||
DROP FUNCTION pgwar.update_entity_label_on_entity_label_change; | ||
DROP FUNCTION pgwar.update_entity_label_on_project_statement_upsert; | ||
DROP FUNCTION pgwar.update_entity_label_on_project_statement_delete; | ||
DROP FUNCTION pgwar.update_entity_labels_after_insert; | ||
DROP FUNCTION pgwar.update_entity_labels_after_update; | ||
DROP FUNCTION pgwar.update_entity_labels_after_delete; | ||
DROP FUNCTION pgwar.update_entity_label_on_entity_label_config_change; | ||
|
||
/*** | ||
* Drop Indexes | ||
* Functions | ||
***/ | ||
DROP INDEX pgwar.entity_label_config_fk_class_idx; | ||
DROP INDEX pgwar.entity_label_config_fk_project_idx; | ||
DROP INDEX pgwar.project_statements_fk_project_fk_object_info_fk_project_idx; | ||
DROP INDEX pgwar.project_statements_fk_project_fk_subject_info_fk_project_idx; | ||
|
||
DROP FUNCTION pgwar.get_entity_label_config(int, int); | ||
DROP FUNCTION pgwar.get_project_entity_label(int, int); | ||
DROP FUNCTION pgwar.get_project_entity_label(int, int, int); | ||
DROP FUNCTION pgwar.get_project_entity_label(int, int, jsonb); | ||
DROP FUNCTION pgwar.update_entity_label_of_entity_preview(int, int, text); | ||
DROP FUNCTION pgwar.get_and_update_project_entity_label(int, int); | ||
|
||
/** | ||
* Views | ||
**/ | ||
|
||
DROP VIEW pgwar.v_community_entity_label; | ||
|
||
/** | ||
* Indexes used by get_project_entity_label | ||
**/ | ||
|
||
DROP INDEX pgwar.project_statements_fk_object_info_fk_project_fk_property_idx; | ||
DROP INDEX pgwar.project_statements_fk_subject_info_fk_project_fk_property_dx; | ||
DROP INDEX pgwar.project_statements_fk_project_fk_property_dx; | ||
DROP INDEX pgwar.project_statements_fk_project_dx; | ||
DROP INDEX information.resource_pk_entity_fk_class_dx; |
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
database/migrations/sqls/20240625144815-war-drop-schema-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 +1 @@ | ||
/* Replace with your SQL commands */ | ||
-- NO WAY BACK |
6 changes: 3 additions & 3 deletions
6
database/migrations/sqls/20240625144815-war-drop-schema-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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
DROP SCHEMA war CASCADE; | ||
DROP SCHEMA IF EXISTS war CASCADE; | ||
|
||
DROP TRIGGER add_entity_preview_partition ON projects.project; | ||
DROP TRIGGER IF EXISTS add_entity_preview_partition ON projects.project; | ||
|
||
DROP FUNCTION projects.add_entity_preview_partition; | ||
DROP FUNCTION IF EXISTS projects.add_entity_preview_partition; |
37 changes: 15 additions & 22 deletions
37
database/migrations/sqls/20240627084826-pgwar-field-change-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,22 +1,15 @@ | ||
-- Function pgwar.field_change_notify_upsert | ||
---------------------------------------------- | ||
DROP FUNCTION IF EXISTS pgwar.field_change_notify_upser; | ||
DROP TRIGGER IF EXISTS after_insert_field_change ON pgwar.field_change; | ||
DROP TRIGGER IF EXISTS after_update_field_change ON pgwar.field_change; | ||
|
||
-- Trigger after_modify_project_statements | ||
---------------------------------------------- | ||
DROP TRIGGER IF EXISTS after_modify_project_statements ON pgwar.project_statements; | ||
|
||
-- Function upsert_field_change | ||
---------------------------------------------- | ||
DROP FUNCTION IF EXISTS pgwar.upsert_field_change; | ||
DROP FUNCTION IF EXISTS pgwar.update_field_change_on_project_statements_modification; | ||
|
||
------ Table pgwar.field_change ----------------------------------------------------- | ||
--------------------------------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS pgwar.field_change; | ||
|
||
|
||
|
||
|
||
-- Drop Triggers | ||
------------------------------------------------------------- | ||
DROP TRIGGER after_update_field_change ON pgwar.field_change; | ||
DROP TRIGGER after_insert_field_change ON pgwar.field_change; | ||
DROP TRIGGER after_modify_project_statements ON pgwar.project_statements; | ||
|
||
-- Drop Functions | ||
------------------------------------------------------------- | ||
DROP FUNCTION pgwar.field_change_notify_upsert; | ||
DROP FUNCTION pgwar.update_field_change_on_project_statements_modification; | ||
DROP FUNCTION pgwar.upsert_field_change; | ||
|
||
-- Drop Table | ||
------------------------------------------------------------- | ||
DROP TABLE pgwar.field_change; |
4 changes: 3 additions & 1 deletion
4
database/migrations/sqls/20240628133110-pgwar-type-label-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 +1,3 @@ | ||
/* Replace with your SQL commands */ | ||
-- Drop Functions | ||
------------------------------------------------------------- | ||
DROP FUNCTION pgwar.update_type_label; |
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