This commit is contained in:
vss-devel 2019-03-04 17:38:35 +03:00
parent 2e46b1510e
commit e95b8d897f

View File

@ -719,7 +719,7 @@ class Redirect extends ArticleStub {
this.toFragment, this.toFragment,
] ]
log( '>', this.title || this.url, row) log( 'r', this.title || this.url, row)
return wiki.db.run( return wiki.db.run(
'INSERT INTO redirects (id, targetKey, fragment) VALUES (?,?,?)', 'INSERT INTO redirects (id, targetKey, fragment) VALUES (?,?,?)',
@ -1226,37 +1226,36 @@ async function initWikiDb () {
} catch (err) { } catch (err) {
} }
wiki.db = await sqlite.open( dbName ) wiki.db = await sqlite.open( dbName )
return await wiki.db.exec( return await wiki.db.exec(`
'PRAGMA synchronous = OFF;' + PRAGMA synchronous = OFF;
//~ 'PRAGMA journal_mode = OFF;' + -- PRAGMA journal_mode = OFF;
'PRAGMA journal_mode = WAL;' + PRAGMA journal_mode = WAL;
'BEGIN;' + BEGIN;
'CREATE TABLE articles (' + [ CREATE TABLE articles (
'id INTEGER PRIMARY KEY', id INTEGER PRIMARY KEY,
'mimeId INTEGER', mimeId INTEGER,
'revision INTEGER', revision INTEGER,
'urlKey TEXT UNIQUE', urlKey TEXT UNIQUE,
'titleKey TEXT', titleKey TEXT
].join(',') + );
');' + CREATE TABLE redirects (
'CREATE TABLE redirects (' + id INTEGER PRIMARY KEY,
'id INTEGER PRIMARY KEY,' + targetKey TEXT,
'targetKey TEXT, ' + fragment TEXT
'fragment TEXT ' + );
');' + CREATE TABLE mimeTypes (
'CREATE TABLE mimeTypes (' + id INTEGER PRIMARY KEY,
'id INTEGER PRIMARY KEY,' + value TEXT
'value TEXT' + );
');' + CREATE TABLE continue (
'CREATE TABLE continue (' + id INTEGER PRIMARY KEY,
'id INTEGER PRIMARY KEY,' + "from" TEXT
'"from" TEXT' + );
');' +
'COMMIT;' + COMMIT;
'' `
) )
} }