-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Update DBs and clients for ingest and storage
- Loading branch information
Showing
77 changed files
with
5,022 additions
and
4,847 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$(call _assert_var,MAKEDIR) | ||
$(call _conditional_include,$(MAKEDIR)/base.mk) | ||
$(call _assert_var,UNAME_OS) | ||
$(call _assert_var,UNAME_ARCH2) | ||
$(call _assert_var,CACHE_VERSIONS) | ||
$(call _assert_var,CACHE_BIN) | ||
|
||
ATLAS_VERSION ?= 0.31.0 | ||
|
||
ATLAS := $(CACHE_VERSIONS)/atlas/$(ATLAS_VERSION) | ||
$(ATLAS): | ||
rm -f $(CACHE_BIN)/atlas | ||
mkdir -p $(CACHE_BIN) | ||
$(eval TMP := $(shell mktemp -d)) | ||
$(eval OS := $(shell echo $(UNAME_OS) | tr A-Z a-z)) | ||
curl -sSL \ | ||
https://release.ariga.io/atlas/atlas-$(OS)-$(UNAME_ARCH2)-v$(ATLAS_VERSION) \ | ||
> $(CACHE_BIN)/atlas | ||
chmod +x $(CACHE_BIN)/atlas | ||
rm -rf $(dir $(ATLAS)) | ||
mkdir -p $(dir $(ATLAS)) | ||
touch $(ATLAS) |
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
8 changes: 8 additions & 0 deletions
8
internal/db/migrations/20250207193001_rename_package_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,8 @@ | ||
-- drop foreign key constraint from "preservation_action" table | ||
ALTER TABLE `preservation_action` DROP FOREIGN KEY `preservation_action_ibfk_1`; | ||
-- rename column from "sip_id" to "package_id" | ||
ALTER TABLE `preservation_action` CHANGE COLUMN `sip_id` `package_id` INT UNSIGNED NOT NULL; | ||
-- rename table from "sip" to "package" | ||
RENAME TABLE `sip` TO `package`; | ||
-- recreate foreign key constraint | ||
ALTER TABLE `preservation_action` ADD CONSTRAINT `preservation_action_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `package` (`id`) ON DELETE CASCADE; |
8 changes: 8 additions & 0 deletions
8
internal/db/migrations/20250207193001_rename_package_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,8 @@ | ||
-- drop foreign key constraint from "preservation_action" table | ||
ALTER TABLE `preservation_action` DROP FOREIGN KEY `preservation_action_ibfk_1`; | ||
-- rename column from "package_id" to "sip_id" | ||
ALTER TABLE `preservation_action` CHANGE COLUMN `package_id` `sip_id` INT UNSIGNED NOT NULL; | ||
-- rename table from "package" to "sip" | ||
RENAME TABLE `package` TO `sip`; | ||
-- recreate foreign key constraint | ||
ALTER TABLE `preservation_action` ADD CONSTRAINT `preservation_action_ibfk_1` FOREIGN KEY (`sip_id`) REFERENCES `sip` (`id`) ON DELETE CASCADE; |
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,49 @@ | ||
-- drop foreign key constraint from "preservation_action" table | ||
ALTER TABLE `preservation_action` DROP FOREIGN KEY `preservation_action_sip_preservation_actions`; | ||
-- modify "sip" table | ||
ALTER TABLE `sip` COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `id` int unsigned NOT NULL AUTO_INCREMENT, | ||
MODIFY COLUMN `name` varchar(2048) NOT NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `workflow_id` varchar(255) NOT NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `run_id` varchar(36) NOT NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `aip_id` varchar(36) NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `location_id` varchar(36) NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), | ||
MODIFY COLUMN `started_at` timestamp(6) NULL, | ||
MODIFY COLUMN `completed_at` timestamp(6) NULL, | ||
DROP INDEX `sip_aip_id_idx`, | ||
DROP INDEX `sip_created_at_idx`, | ||
DROP INDEX `sip_location_id_idx`, | ||
DROP INDEX `sip_name_idx`, | ||
DROP INDEX `sip_started_at_idx`, | ||
DROP INDEX `sip_status_idx`, | ||
ADD INDEX `package_aip_id_idx` (`aip_id`), | ||
ADD INDEX `package_created_at_idx` (`created_at`), | ||
ADD INDEX `package_location_id_idx` (`location_id`), | ||
ADD INDEX `package_name_idx` (`name` (50)), | ||
ADD INDEX `package_started_at_idx` (`started_at`), | ||
ADD INDEX `package_status_idx` (`status`); | ||
-- drop foreign key constraint from "preservation_task" table | ||
ALTER TABLE `preservation_task` DROP FOREIGN KEY `preservation_task_preservation_action_tasks`; | ||
-- modify "preservation_action" table | ||
ALTER TABLE `preservation_action` COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `id` int unsigned NOT NULL AUTO_INCREMENT, | ||
MODIFY COLUMN `workflow_id` varchar(255) NOT NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `started_at` timestamp(6) NULL, | ||
MODIFY COLUMN `completed_at` timestamp(6) NULL, | ||
MODIFY COLUMN `sip_id` int unsigned NOT NULL, | ||
DROP INDEX `preservation_action_sip_preservation_actions`, | ||
ADD CONSTRAINT `preservation_action_ibfk_1` | ||
FOREIGN KEY (`sip_id`) REFERENCES `sip` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE; | ||
-- modify "preservation_task" table | ||
ALTER TABLE `preservation_task` COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `id` int unsigned NOT NULL AUTO_INCREMENT, | ||
MODIFY COLUMN `task_id` varchar(36) NOT NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `name` varchar(2048) NOT NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `started_at` timestamp(6) NULL, | ||
MODIFY COLUMN `completed_at` timestamp(6) NULL, | ||
MODIFY COLUMN `note` longtext NOT NULL COLLATE utf8mb4_0900_ai_ci, | ||
MODIFY COLUMN `preservation_action_id` int unsigned NOT NULL, | ||
DROP INDEX `preservation_task_preservation_action_tasks`, | ||
ADD CONSTRAINT `preservation_task_ibfk_1` | ||
FOREIGN KEY (`preservation_action_id`) REFERENCES `preservation_action` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE; |
Oops, something went wrong.