Compare commits

..

5 Commits

Author SHA1 Message Date
Owen Schwartz
6a7d4fd385 Merge pull request #3021 from fosrl/dev
If not exists on trial table
2026-05-06 20:00:55 -07:00
Owen
7bc08c0425 If not exists on trial table 2026-05-06 20:00:23 -07:00
Owen Schwartz
36a47c4cfb Merge pull request #3015 from fosrl/dev
Dev
2026-05-06 16:59:02 -07:00
Owen
7dce4500ec Merge branch 'dev' of github.com:fosrl/pangolin into dev 2026-05-06 16:58:39 -07:00
Owen
72e48a56df Remove explicit call 2026-05-06 16:58:28 -07:00
2 changed files with 2 additions and 8 deletions

View File

@@ -3,8 +3,6 @@ import { sql } from "drizzle-orm";
const version = "1.18.3";
await migration();
export default async function migration() {
console.log(`Running setup script ${version}...`);
@@ -46,7 +44,7 @@ export default async function migration() {
await db.execute(sql`BEGIN`);
await db.execute(sql`
CREATE TABLE "trialNotifications" (
CREATE TABLE IF NOT EXISTS "trialNotifications" (
"notificationId" serial PRIMARY KEY NOT NULL,
"subscriptionId" varchar(255) NOT NULL,
"notificationType" varchar(50) NOT NULL,
@@ -54,10 +52,6 @@ export default async function migration() {
);
`);
await db.execute(sql`
ALTER TABLE "trialNotifications" ADD CONSTRAINT "trialNotifications_subscriptionId_subscriptions_subscriptionId_fk" FOREIGN KEY ("subscriptionId") REFERENCES "public"."subscriptions"("subscriptionId") ON DELETE cascade ON UPDATE no action;
`);
await db.execute(sql`COMMIT`);
console.log("Migrated database");
} catch (e) {

View File

@@ -16,7 +16,7 @@ export default async function migration() {
db.transaction(() => {
db.prepare(
`
CREATE TABLE 'trialNotifications' (
CREATE TABLE IF NOT EXISTS 'trialNotifications' (
'notificationId' integer PRIMARY KEY AUTOINCREMENT NOT NULL,
'subscriptionId' text NOT NULL,
'notificationType' text NOT NULL,