From 406b726daa328ab497e9fe8f5e065d1e6f2193fc Mon Sep 17 00:00:00 2001 From: Alexander Zhylin Date: Wed, 6 May 2026 18:23:32 +0300 Subject: [PATCH] sqlite: adapt SQL-queries to be compatible with SQLite3 --- src/db/db_sqlite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/db_sqlite.c b/src/db/db_sqlite.c index facaf8a..66f9346 100644 --- a/src/db/db_sqlite.c +++ b/src/db/db_sqlite.c @@ -84,7 +84,7 @@ int check_and_create_tables() { print_err(&err); res = sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS 'files' (" - " 'id' SERIAL," + " 'id'INTEGER NOT NULL UNIQUE," " 'user_id' INTEGER NULL," " 'name' VARCHAR(255) NOT NULL," " 'size' BIGINT NOT NULL," @@ -92,7 +92,7 @@ int check_and_create_tables() { " 'description' TEXT NULL," " 'permissions' INTEGER NULL," " 'hash' INTEGER NULL," - " CONSTRAINT 'files_pkey' PRIMARY KEY ('id')," + " CONSTRAINT 'files_pkey' PRIMARY KEY('id' AUTOINCREMENT)," " CONSTRAINT 'fk_user' FOREIGN KEY ('user_id')" " REFERENCES 'users' ('id') ON DELETE NO ACTION" " ON UPDATE NO ACTION"