From 15eb9611d0fc076f1ad941e7a55244ae1cc73202 Mon Sep 17 00:00:00 2001
From: Runxi Yu <me@runxiyu.org>
Date: Wed, 12 Feb 2025 00:44:32 +0800
Subject: schema.sql: Fixes

---
 schema.sql | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index f8fe980..f90480d 100644
--- a/schema.sql
+++ b/schema.sql
@@ -39,9 +39,9 @@ CREATE TABLE emails (
 	id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
 	list_id INTEGER NOT NULL REFERENCES mailing_lists(id) ON DELETE CASCADE,
 	title TEXT NOT NULL,
-	from TEXT NOT NULL,
-	date TIMESTAMP,
-	content BYTEA
+	sender TEXT NOT NULL,
+	date TIMESTAMP NOT NULL,
+	content BYTEA NOT NULL
 );
 
 CREATE TABLE merge_requests (
@@ -51,8 +51,7 @@ CREATE TABLE merge_requests (
 	source_ref TEXT NOT NULL,
 	destination_branch TEXT NOT NULL,
 	status TEXT NOT NULL CHECK (status IN ('open', 'merged', 'closed')),
-	created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-	updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+	created_at TIMESTAMP NOT NULL,
 	mailing_list_id INT UNIQUE REFERENCES mailing_lists(id) ON DELETE CASCADE
 );
 
-- 
cgit v1.2.3

