From 3225e59bb15cb0f8f48ad2f3f976209a74e07752 Mon Sep 17 00:00:00 2001
From: EuAndreh <eu@euandre.org>
Date: Tue, 22 Oct 2024 10:39:08 -0300
Subject: Remove "metadata" column from tables

---
 tests/queries.sql | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

(limited to 'tests/queries.sql')

diff --git a/tests/queries.sql b/tests/queries.sql
index c44a6c5..7e20ae9 100644
--- a/tests/queries.sql
+++ b/tests/queries.sql
@@ -7,8 +7,7 @@
 			uuid         BLOB    NOT NULL UNIQUE,
 			email        TEXT    NOT NULL UNIQUE,
 			salt         BLOB    NOT NULL UNIQUE,
-			pwhash       BLOB    NOT NULL,
-			metadata     TEXT
+			pwhash       BLOB    NOT NULL
 		);
 		CREATE TABLE IF NOT EXISTS "gracha_confirmation_attempts" (
 			id           INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -43,7 +42,6 @@
 			id           INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 			user_id      INTEGER NOT NULL REFERENCES "gracha_users"(id),
 			role         TEXT    NOT NULL,
-			metadata     TEXT,
 			UNIQUE (user_id, role)
 		);
 		CREATE TABLE IF NOT EXISTS "gracha_role_changes" (
@@ -57,19 +55,17 @@
 			id           INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 			timestamp    TEXT    NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%f000000Z', 'now')),
 			uuid         BLOB    NOT NULL UNIQUE,
-			user_id      INTEGER NOT NULL REFERENCES "gracha_users"(id),
+			user_id      INTEGER NOT NULL REFERENCES "gracha_users"(id)
 			-- type         TEXT    NOT NULL,
 			-- revoked_at   TEXT,
 			-- revoker_id   INTEGER          REFERENCES "gracha_users"(id),
 			-- FIXME: add provenance: login, refresh, confirmation, etc.
-			metadata     TEXT
 		);
 		CREATE TABLE IF NOT EXISTS "gracha_attempts" (
 			id           INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 			timestamp    TEXT    NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%f000000Z', 'now')),
 			user_id      INTEGER          REFERENCES "gracha_users"(id),
-			session_id   INTEGER          REFERENCES "gracha_sessions"(id),
-			metadata     TEXT
+			session_id   INTEGER          REFERENCES "gracha_sessions"(id)
 		);
 		CREATE TABLE IF NOT EXISTS "gracha_audit" (
 			id           INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -77,8 +73,7 @@
 			uuid         BLOB    NOT NULL UNIQUE,
 			attribute    TEXT    NOT NULL,
 			value        TEXT    NOT NULL,
-			op           BOOLEAN NOT NULL,
-			metadata     TEXT
+			op           BOOLEAN NOT NULL
 		);
 	
 
@@ -88,7 +83,7 @@
 --   write:
 
 --    read:
-		SELECT id, timestamp, uuid, salt, pwhash, metadata, (
+		SELECT id, timestamp, uuid, salt, pwhash, (
 			CASE WHEN EXISTS (
 				SELECT id FROM "gracha_user_confirmations"
 				WHERE user_id = (
-- 
cgit v1.2.3

