From df384aca4ea164a9d63e40facf8ff10fa51f4321 Mon Sep 17 00:00:00 2001
From: Runxi Yu <me@runxiyu.org>
Date: Wed, 12 Feb 2025 23:23:47 +0800
Subject: schema.sql: Reorder (or it'll error out)

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

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index f90480d..fbd9ac8 100644
--- a/schema.sql
+++ b/schema.sql
@@ -44,6 +44,13 @@ CREATE TABLE emails (
 	content BYTEA NOT NULL
 );
 
+CREATE TABLE users (
+	id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
+	username TEXT NOT NULL UNIQUE,
+	password_algorithm TEXT NOT NULL CHECK (password_algorithm in ('argon2id')),
+	password TEXT NOT NULL
+);
+
 CREATE TABLE merge_requests (
 	id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
 	repo_id INTEGER NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
@@ -55,13 +62,6 @@ CREATE TABLE merge_requests (
 	mailing_list_id INT UNIQUE REFERENCES mailing_lists(id) ON DELETE CASCADE
 );
 
-CREATE TABLE users (
-	id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
-	username TEXT NOT NULL UNIQUE,
-	password_algorithm TEXT NOT NULL CHECK (password_algorithm in ('argon2id')),
-	password TEXT NOT NULL
-);
-
 CREATE TABLE ssh_public_keys (
 	id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
 	user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
-- 
cgit v1.2.3

