From 5ef424120ed694b1f69daeafaa1454455d13dee2 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Wed, 31 Jan 2024 16:50:01 +0300
Subject: CI: enable SQLite

* SQLite JDBC driver does not support generated keys feature. So we implement `returningId` helper
* only one connection should be used from connection pooler
* changes made to prevent connection locking
---
 src/main/resources/schema-h2.sql | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'src/main/resources/schema-h2.sql')

diff --git a/src/main/resources/schema-h2.sql b/src/main/resources/schema-h2.sql
index 7aaee493..5fd7fff8 100644
--- a/src/main/resources/schema-h2.sql
+++ b/src/main/resources/schema-h2.sql
@@ -114,7 +114,7 @@ CREATE MEMORY TABLE "PUBLIC"."REPLIES"(
     "USER_ID" INTEGER NOT NULL,
     "REPLYTO" SMALLINT DEFAULT '0' NOT NULL,
     "TS" TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    "ATTACH" CHARACTER(3),
+    "ATTACH" ENUM('jpg', 'mp4', 'png') DEFAULT NULL,
     "TXT" CHARACTER VARYING NOT NULL,
     "UPDATED_AT" TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP NOT NULL,
     "USER_URI" CHARACTER VARYING(255) DEFAULT NULL,
@@ -131,7 +131,7 @@ CREATE MEMORY TABLE "PUBLIC"."MESSAGES"(
     "MAXREPLYID" SMALLINT DEFAULT '0' NOT NULL,
     "PRIVACY" TINYINT DEFAULT '1' NOT NULL,
     "READONLY" TINYINT DEFAULT '0' NOT NULL,
-    "ATTACH" CHARACTER(3),
+    "ATTACH" ENUM('jpg', 'mp4', 'png') DEFAULT NULL,
     "PLACE_ID" INTEGER DEFAULT NULL,
     "LAT" DECIMAL(10, 7) DEFAULT NULL,
     "LON" DECIMAL(10, 7) DEFAULT NULL,
@@ -251,8 +251,6 @@ CREATE MEMORY TABLE "PUBLIC"."USER_SERVICES"(
     "TS" TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
     "SERVICE_TYPE" CHARACTER VARYING(255) DEFAULT 'fcm' NOT NULL
 );
-ALTER TABLE "PUBLIC"."MESSAGES" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_131" CHECK("ATTACH" IN('jpg', 'mp4', 'png')) NOCHECK;
-ALTER TABLE "PUBLIC"."REPLIES" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_6C" CHECK("ATTACH" IN('jpg', 'mp4', 'png')) NOCHECK;
 ALTER TABLE "PUBLIC"."LOGINS" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_86" UNIQUE("USER_ID");
 ALTER TABLE "PUBLIC"."REACTIONS" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_6" UNIQUE("LIKE_ID");
 ALTER TABLE "PUBLIC"."SUBSCR_TAGS" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_B" UNIQUE("TAG_ID", "SUSER_ID");
-- 
cgit v1.2.3

