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-sqlite.sql | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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

diff --git a/src/main/resources/schema-sqlite.sql b/src/main/resources/schema-sqlite.sql
index b0858f1b..74ba28b6 100644
--- a/src/main/resources/schema-sqlite.sql
+++ b/src/main/resources/schema-sqlite.sql
@@ -1,5 +1,3 @@
-PRAGMA journal_mode=WAL;
-PRAGMA busy_timeout=30000;
 CREATE TABLE user_services (
     user_id INTEGER NOT NULL,
     regid character varying(1024) NOT NULL,
@@ -44,7 +42,7 @@ CREATE TABLE facebook (
     ts DEFAULT (strftime('%s','now') || substr(strftime('%f','now'),4)) NOT NULL,
     fb_name character varying(64),
     fb_link character varying(255) NOT NULL,
-    crosspost boolean DEFAULT true NOT NULL,
+    crosspost boolean DEFAULT TRUE NOT NULL,
     FOREIGN KEY (user_id) REFERENCES users(id)
 );
 CREATE TABLE favorites (
@@ -91,7 +89,7 @@ CREATE TABLE messages (
     replies smallint DEFAULT (0) NOT NULL,
     maxreplyid smallint DEFAULT (0) NOT NULL,
     privacy smallint DEFAULT (1) NOT NULL,
-    readonly boolean DEFAULT false NOT NULL,
+    readonly boolean DEFAULT FALSE NOT NULL,
     attach TEXT CHECK (attach IN ('jpg', 'mp4', 'png')),
     place_id bigint,
     lat numeric(10,7),
@@ -215,7 +213,7 @@ CREATE TABLE twitter (
     access_token_secret character varying(64) NOT NULL,
     uname character varying(64) NOT NULL,
     ts DEFAULT (strftime('%s','now') || substr(strftime('%f','now'),4)) NOT NULL,
-    crosspost boolean DEFAULT true NOT NULL,
+    crosspost boolean DEFAULT TRUE NOT NULL,
     FOREIGN KEY (user_id) REFERENCES users(id)
 );
 CREATE TABLE users (
-- 
cgit v1.2.3

