High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
JavaScript campaigncampaign-managementemail-marketingemail-subscriptionlistmonkmailing-listnewsletternewsletter-managementnewsletter-softwareself-hostedsms-gatewaysmtptransactional-emails
Add missing `bounce_type` to v2 migration.
Kailash Nadhfd8f5a96c967
diff --git a/internal/migrations/v2.0.0.go b/internal/migrations/v2.0.0.goindex 4e6b9a95..92f8dbac 100644--- a/internal/migrations/v2.0.0.go+++ b/internal/migrations/v2.0.0.go@@ -8,6 +8,17 @@ import (// V2_0_0 performs the DB migrations for v.1.0.0.func V2_0_0(db *sqlx.DB, fs stuffbin.FileSystem, ko *koanf.Koanf) error {+ if _, err := db.Exec(`+ DO $$+ BEGIN+ IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'bounce_type') THEN+ CREATE TYPE bounce_type AS ENUM ('soft', 'hard', 'complaint');+ END IF;+ END$$;+ `); err != nil {+ return err+ }+if _, err := db.Exec(`CREATE TABLE IF NOT EXISTS bounces (id SERIAL PRIMARY KEY,diff --git a/schema.sql b/schema.sqlindex 848f7861..8a4f41b9 100644--- a/schema.sql+++ b/schema.sql@@ -102,7 +102,7 @@ CREATE TABLE campaigns (DROP TABLE IF EXISTS campaign_lists CASCADE;CREATE TABLE campaign_lists (- id BIGSERIAL PRIMARY KEY,+ id BIGSERIAL PRIMARY KEY,campaign_id INTEGER NOT NULL REFERENCES campaigns(id) ON DELETE CASCADE ON UPDATE CASCADE,-- Lists may be deleted, so list_id is nullable