-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify purging artifact using null app id
- Loading branch information
1 parent
e616a54
commit 09704f1
Showing
6 changed files
with
1,795 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TRIGGER IF EXISTS "add_app_to_purge_artifact"; |
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,23 @@ | ||
PRAGMA foreign_keys=OFF;--> statement-breakpoint | ||
CREATE TABLE `__new_artifacts` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`fileObjectKey` text NOT NULL, | ||
`file_object_apk_key` text, | ||
`versionName2` text NOT NULL, | ||
`versionCode2` text NOT NULL, | ||
`releaseNotes` text, | ||
`createdAt` integer, | ||
`updatedAt` integer, | ||
`releaseId` integer NOT NULL, | ||
`extension` text, | ||
`packageName` text, | ||
`appsId` text, | ||
FOREIGN KEY (`appsId`) REFERENCES `apps`(`id`) ON UPDATE no action ON DELETE set null | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_artifacts`("id", "fileObjectKey", "file_object_apk_key", "versionName2", "versionCode2", "releaseNotes", "createdAt", "updatedAt", "releaseId", "extension", "packageName", "appsId") SELECT "id", "fileObjectKey", "file_object_apk_key", "versionName2", "versionCode2", "releaseNotes", "createdAt", "updatedAt", "releaseId", "extension", "packageName", "appsId" FROM `artifacts`;--> statement-breakpoint | ||
DROP TABLE `artifacts`;--> statement-breakpoint | ||
ALTER TABLE `__new_artifacts` RENAME TO `artifacts`;--> statement-breakpoint | ||
PRAGMA foreign_keys=ON;--> statement-breakpoint | ||
CREATE UNIQUE INDEX `artifacts_id_unique` ON `artifacts` (`id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `artifacts_appsId_releaseId_unique` ON `artifacts` (`appsId`,`releaseId`); |
Oops, something went wrong.