Skip to content

Commit

Permalink
Simplify purging artifact using null app id
Browse files Browse the repository at this point in the history
  • Loading branch information
yunusefendi52 committed Dec 4, 2024
1 parent e616a54 commit 09704f1
Show file tree
Hide file tree
Showing 6 changed files with 1,795 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/db/drizzle/0046_demonic_zemo.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TRIGGER IF EXISTS "add_app_to_purge_artifact";
23 changes: 23 additions & 0 deletions server/db/drizzle/0047_solid_cassandra_nova.sql
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`);
Loading

0 comments on commit 09704f1

Please sign in to comment.