Don't add primary keys with sqlite

This commit is contained in:
Ajay 2022-05-17 12:53:48 -04:00
parent c9a0fb7bc3
commit 21f7d5d938
3 changed files with 19 additions and 21 deletions

View file

@ -2,13 +2,13 @@ BEGIN TRANSACTION;
-- Add primary keys -- Add primary keys
ALTER TABLE "userNameLogs" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "userNameLogs" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
ALTER TABLE "categoryVotes" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "categoryVotes" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
ALTER TABLE "sponsorTimes" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "sponsorTimes" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
ALTER TABLE "config" ADD PRIMARY KEY ("key"); ALTER TABLE "config" ADD PRIMARY KEY ("key"); --!sqlite-ignore
ALTER TABLE "ratings" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "ratings" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
ALTER TABLE "tempVipLog" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "tempVipLog" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
ALTER TABLE "votes" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "votes" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
UPDATE "config" SET value = 8 WHERE key = 'version'; UPDATE "config" SET value = 8 WHERE key = 'version';

View file

@ -2,17 +2,17 @@ BEGIN TRANSACTION;
-- Add primary keys -- Add primary keys
ALTER TABLE "sponsorTimes" ADD PRIMARY KEY ("UUID"); ALTER TABLE "sponsorTimes" ADD PRIMARY KEY ("UUID"); --!sqlite-ignore
ALTER TABLE "vipUsers" ADD PRIMARY KEY ("userID"); ALTER TABLE "vipUsers" ADD PRIMARY KEY ("userID"); --!sqlite-ignore
ALTER TABLE "userNames" ADD PRIMARY KEY ("userID"); ALTER TABLE "userNames" ADD PRIMARY KEY ("userID"); --!sqlite-ignore
ALTER TABLE "categoryVotes" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "categoryVotes" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
ALTER TABLE "lockCategories" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "lockCategories" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
ALTER TABLE "warnings" ADD PRIMARY KEY ("userID", "issueTime"); ALTER TABLE "warnings" ADD PRIMARY KEY ("userID", "issueTime"); --!sqlite-ignore
ALTER TABLE "shadowBannedUsers" ADD PRIMARY KEY ("userID"); ALTER TABLE "shadowBannedUsers" ADD PRIMARY KEY ("userID"); --!sqlite-ignore
ALTER TABLE "unlistedVideos" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "unlistedVideos" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
ALTER TABLE "config" ADD PRIMARY KEY ("key"); ALTER TABLE "config" ADD PRIMARY KEY ("key"); --!sqlite-ignore
ALTER TABLE "archivedSponsorTimes" ADD PRIMARY KEY ("UUID"); ALTER TABLE "archivedSponsorTimes" ADD PRIMARY KEY ("UUID"); --!sqlite-ignore
ALTER TABLE "ratings" ADD "id" SERIAL PRIMARY KEY; ALTER TABLE "ratings" ADD "id" SERIAL PRIMARY KEY; --!sqlite-ignore
UPDATE "config" SET value = 32 WHERE key = 'version'; UPDATE "config" SET value = 32 WHERE key = 'version';

View file

@ -93,9 +93,7 @@ export class Sqlite implements IDatabase {
} }
private static processUpgradeQuery(query: string): string { private static processUpgradeQuery(query: string): string {
const result = query.replace(/^.*--!sqlite-ignore/gm, ""); return query.replace(/^.*--!sqlite-ignore/gm, "");
return result;
} }
} }