chore: update migration

This commit is contained in:
Mauricio Siu 2024-07-16 00:39:26 -06:00
parent 79ad0818f5
commit 1bf518f768
13 changed files with 38 additions and 14643 deletions

View File

@ -1,3 +1,9 @@
DO $$ BEGIN
CREATE TYPE "public"."notificationType" AS ENUM('slack', 'telegram', 'discord', 'email');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "discord" (
"discordId" text PRIMARY KEY NOT NULL,
"webhookUrl" text NOT NULL
@ -6,9 +12,10 @@ CREATE TABLE IF NOT EXISTS "discord" (
CREATE TABLE IF NOT EXISTS "email" (
"emailId" text PRIMARY KEY NOT NULL,
"smtpServer" text NOT NULL,
"smtpPort" text NOT NULL,
"smtpPort" integer NOT NULL,
"username" text NOT NULL,
"password" text NOT NULL,
"fromAddress" text NOT NULL,
"toAddress" text[] NOT NULL
);
--> statement-breakpoint
@ -20,6 +27,7 @@ CREATE TABLE IF NOT EXISTS "notification" (
"appBuildError" boolean DEFAULT false NOT NULL,
"databaseBackup" boolean DEFAULT false NOT NULL,
"dokployRestart" boolean DEFAULT false NOT NULL,
"notificationType" "notificationType" NOT NULL,
"createdAt" text NOT NULL,
"slackId" text,
"telegramId" text,
@ -30,7 +38,7 @@ CREATE TABLE IF NOT EXISTS "notification" (
CREATE TABLE IF NOT EXISTS "slack" (
"slackId" text PRIMARY KEY NOT NULL,
"webhookUrl" text NOT NULL,
"channel" text NOT NULL
"channel" text
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "telegram" (

View File

@ -1,7 +0,0 @@
DO $$ BEGIN
CREATE TYPE "public"."notificationType" AS ENUM('slack', 'telegram', 'discord', 'email');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "notification" ADD COLUMN "notificationType" "notificationType" NOT NULL;

View File

@ -1 +0,0 @@
ALTER TABLE "email" ADD COLUMN "fromAddress" text NOT NULL;

View File

@ -1 +0,0 @@
ALTER TABLE "slack" ALTER COLUMN "channel" DROP NOT NULL;

View File

@ -1 +0,0 @@
ALTER TABLE "email" ALTER COLUMN "smtpServer" SET DATA TYPE integer;

View File

@ -1,2 +0,0 @@
ALTER TABLE "email" ALTER COLUMN "smtpServer" SET DATA TYPE text;--> statement-breakpoint
ALTER TABLE "email" ALTER COLUMN "smtpPort" SET DATA TYPE integer;

View File

@ -1,5 +1,5 @@
{
"id": "66d1d683-ad31-4ef4-873d-e672ff707a6d",
"id": "7c8f815f-4fec-4505-b9c7-c28bac3451f0",
"prevId": "3d47456f-03b7-4b45-87f2-057df7e9cb0b",
"version": "6",
"dialect": "postgresql",
@ -2541,7 +2541,7 @@
},
"smtpPort": {
"name": "smtpPort",
"type": "text",
"type": "integer",
"primaryKey": false,
"notNull": true
},
@ -2557,6 +2557,12 @@
"primaryKey": false,
"notNull": true
},
"fromAddress": {
"name": "fromAddress",
"type": "text",
"primaryKey": false,
"notNull": true
},
"toAddress": {
"name": "toAddress",
"type": "text[]",
@ -2620,6 +2626,13 @@
"notNull": true,
"default": false
},
"notificationType": {
"name": "notificationType",
"type": "notificationType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "text",
@ -2729,7 +2742,7 @@
"name": "channel",
"type": "text",
"primaryKey": false,
"notNull": true
"notNull": false
}
},
"indexes": {},
@ -2885,6 +2898,16 @@
"selfHosted",
"cloud"
]
},
"public.notificationType": {
"name": "notificationType",
"schema": "public",
"values": [
"slack",
"telegram",
"discord",
"email"
]
}
},
"schemas": {},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -138,43 +138,8 @@
{
"idx": 19,
"version": "6",
"when": 1720507012671,
"tag": "0019_careless_hardball",
"breakpoints": true
},
{
"idx": 20,
"version": "6",
"when": 1720762222675,
"tag": "0020_ambitious_edwin_jarvis",
"breakpoints": true
},
{
"idx": 21,
"version": "6",
"when": 1720768664067,
"tag": "0021_nervous_dragon_lord",
"breakpoints": true
},
{
"idx": 22,
"version": "6",
"when": 1720935190450,
"tag": "0022_keen_norrin_radd",
"breakpoints": true
},
{
"idx": 23,
"version": "6",
"when": 1720937318257,
"tag": "0023_military_korg",
"breakpoints": true
},
{
"idx": 24,
"version": "6",
"when": 1720937370382,
"tag": "0024_bored_the_hand",
"when": 1721110706912,
"tag": "0019_heavy_freak",
"breakpoints": true
}
]