mirror of
https://github.com/simon987/sist2.git
synced 2025-04-10 14:06:45 +00:00
Version bump, fix #392
This commit is contained in:
parent
70242846ae
commit
f56cfb0f2f
@ -163,7 +163,7 @@ void database_open(database_t *db) {
|
||||
&db->write_document_sidecar_stmt, NULL));
|
||||
CRASH_IF_NOT_SQLITE_OK(sqlite3_prepare_v2(
|
||||
db->db,
|
||||
"REPLACE INTO document (id, mtime, size, json_data) VALUES (?, ?, ?, ?);", -1,
|
||||
"REPLACE INTO document (id, mtime, size, json_data, version) VALUES (?, ?, ?, ?, (SELECT max(id) FROM version));", -1,
|
||||
&db->write_document_stmt, NULL));
|
||||
CRASH_IF_NOT_SQLITE_OK(sqlite3_prepare_v2(
|
||||
db->db,
|
||||
@ -796,3 +796,8 @@ cJSON *database_get_document(database_t *db, char *doc_id) {
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
void database_increment_version(database_t *db) {
|
||||
CRASH_IF_NOT_SQLITE_OK(sqlite3_exec(
|
||||
db->db, "INSERT INTO version DEFAULT VALUES", NULL, NULL, NULL));
|
||||
}
|
||||
|
@ -126,6 +126,8 @@ void database_open(database_t *db);
|
||||
|
||||
void database_close(database_t *, int optimize);
|
||||
|
||||
void database_increment_version(database_t *db);
|
||||
|
||||
void database_write_thumbnail(database_t *db, const char *id, int num, void *data, size_t data_size);
|
||||
|
||||
void *database_read_thumbnail(database_t *db, const char *id, int num, size_t *return_value_len);
|
||||
|
@ -96,9 +96,15 @@ const char *IndexDatabaseSchema =
|
||||
" PRIMARY KEY(id, num)"
|
||||
") WITHOUT ROWID;"
|
||||
""
|
||||
"CREATE TABLE version ("
|
||||
" id INTEGER PRIMARY KEY AUTOINCREMENT,"
|
||||
" date TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP)"
|
||||
");"
|
||||
""
|
||||
"CREATE TABLE document ("
|
||||
" id TEXT PRIMARY KEY CHECK ( length(id) = 32 ),"
|
||||
" marked INTEGER NOT NULL DEFAULT (1),"
|
||||
" version INTEGER NOT NULL REFERENCES version(id),"
|
||||
" mtime INTEGER NOT NULL,"
|
||||
" size INTEGER NOT NULL,"
|
||||
" json_data TEXT NOT NULL CHECK ( json_valid(json_data) )"
|
||||
|
@ -75,6 +75,8 @@ void database_scan_begin(scan_args_t *args) {
|
||||
database_write_index_descriptor(db, desc);
|
||||
}
|
||||
|
||||
database_increment_version(db);
|
||||
|
||||
database_close(db, FALSE);
|
||||
}
|
||||
|
||||
|
@ -51,11 +51,11 @@
|
||||
#include <ctype.h>
|
||||
#include "git_hash.h"
|
||||
|
||||
#define VERSION "3.1.4"
|
||||
#define VERSION "3.2.0"
|
||||
static const char *const Version = VERSION;
|
||||
static const int VersionMajor = 3;
|
||||
static const int VersionMinor = 1;
|
||||
static const int VersionPatch = 4;
|
||||
static const int VersionMinor = 2;
|
||||
static const int VersionPatch = 0;
|
||||
|
||||
#ifndef SIST_PLATFORM
|
||||
#define SIST_PLATFORM unknown
|
||||
|
Loading…
x
Reference in New Issue
Block a user