also looking at this
fix(dashboard): stop remote commands importing an absent config module
#59
5 files
+114
-0
| @@ -0,0 +1,27 @@ | ||
| 1 | -- AnalyticsHQ enables the framework newsletter routes, but its application | |
| 2 | -- migration corpus predates the framework Subscriber models. Keep the schema | |
| 3 | -- here so a clean PostgreSQL database can serve the public signup action. | |
| 4 | CREATE TABLE IF NOT EXISTS "subscribers" ( | |
| 5 | "id" BIGSERIAL PRIMARY KEY, | |
| 6 | "email" varchar(255) NOT NULL, | |
| 7 | "status" varchar(32) NOT NULL DEFAULT 'subscribed' CHECK ("status" IN ('subscribed', 'unsubscribed', 'pending', 'bounced')), | |
| 8 | "source" varchar(100) DEFAULT 'homepage', | |
| 9 | "unsubscribed_at" timestamp, | |
| 10 | "user_id" bigint REFERENCES "users"("id"), | |
| 11 | "created_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 12 | "updated_at" timestamp, | |
| 13 | "uuid" varchar(255) | |
| 14 | ); | |
| 15 | CREATE UNIQUE INDEX IF NOT EXISTS "subscribers_email_unique" ON "subscribers" ("email"); | |
| 16 | CREATE UNIQUE INDEX IF NOT EXISTS "subscribers_uuid_unique" ON "subscribers" ("uuid"); | |
| 17 | ||
| 18 | CREATE TABLE IF NOT EXISTS "subscriber_emails" ( | |
| 19 | "id" BIGSERIAL PRIMARY KEY, | |
| 20 | "email" varchar(255) NOT NULL, | |
| 21 | "source" varchar(100) DEFAULT 'homepage', | |
| 22 | "subscriber_id" bigint REFERENCES "subscribers"("id"), | |
| 23 | "created_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 24 | "updated_at" timestamp, | |
| 25 | "uuid" varchar(255) | |
| 26 | ); | |
| 27 | CREATE UNIQUE INDEX IF NOT EXISTS "subscriber_emails_uuid_unique" ON "subscriber_emails" ("uuid"); | |