From 01e4fd482ebcc827d3c76c00910529abbf666454 Mon Sep 17 00:00:00 2001
From: Runxi Yu <me@runxiyu.org>
Date: Sun, 14 Sep 2025 22:28:12 +0800
Subject: Add basic mailing lists

---
 sql/schema.sql | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'sql/schema.sql')

diff --git a/sql/schema.sql b/sql/schema.sql
index 92ae605..7805377 100644
--- a/sql/schema.sql
+++ b/sql/schema.sql
@@ -36,6 +36,13 @@ CREATE TABLE mailing_list_emails (
 	content BYTEA NOT NULL
 );
 
+CREATE TABLE mailing_list_subscribers (
+	id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
+	list_id INTEGER NOT NULL REFERENCES mailing_lists(id) ON DELETE CASCADE,
+	email TEXT NOT NULL,
+	UNIQUE (list_id, email)
+);
+
 CREATE TABLE users (
 	id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
 	username TEXT UNIQUE,
-- 
cgit v1.2.3

