sqlite: adapt SQL-queries to be compatible with SQLite3
This commit is contained in:
+2
-2
@@ -84,7 +84,7 @@ int check_and_create_tables() {
|
|||||||
print_err(&err);
|
print_err(&err);
|
||||||
res = sqlite3_exec(db,
|
res = sqlite3_exec(db,
|
||||||
"CREATE TABLE IF NOT EXISTS 'files' ("
|
"CREATE TABLE IF NOT EXISTS 'files' ("
|
||||||
" 'id' SERIAL,"
|
" 'id'INTEGER NOT NULL UNIQUE,"
|
||||||
" 'user_id' INTEGER NULL,"
|
" 'user_id' INTEGER NULL,"
|
||||||
" 'name' VARCHAR(255) NOT NULL,"
|
" 'name' VARCHAR(255) NOT NULL,"
|
||||||
" 'size' BIGINT NOT NULL,"
|
" 'size' BIGINT NOT NULL,"
|
||||||
@@ -92,7 +92,7 @@ int check_and_create_tables() {
|
|||||||
" 'description' TEXT NULL,"
|
" 'description' TEXT NULL,"
|
||||||
" 'permissions' INTEGER NULL,"
|
" 'permissions' INTEGER NULL,"
|
||||||
" 'hash' 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')"
|
" CONSTRAINT 'fk_user' FOREIGN KEY ('user_id')"
|
||||||
" REFERENCES 'users' ('id') ON DELETE NO ACTION"
|
" REFERENCES 'users' ('id') ON DELETE NO ACTION"
|
||||||
" ON UPDATE NO ACTION"
|
" ON UPDATE NO ACTION"
|
||||||
|
|||||||
Reference in New Issue
Block a user