sqlite: adapt SQL-queries to be compatible with SQLite3

This commit is contained in:
2026-05-06 18:23:32 +03:00
parent 4ce763e18f
commit 406b726daa
+2 -2
View File
@@ -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"