1
0

Move fv and tv into files table.

This commit is contained in:
2017-12-12 01:51:18 +01:00
parent c675eeacbf
commit 6d8f3bda7b
2 changed files with 8 additions and 7 deletions

View File

@ -14,6 +14,7 @@ class SQLiteWriter
if ($this->pdo === false) {
return $sqlerror;
}
$this->pdo->exec('PRAGMA foreign_keys=on;');
}
private function insertArray($table, $data, $replace = false)
@ -75,6 +76,8 @@ class SQLiteWriter
'sha1' => $file_arr['file_sha1'],
'file_name' => $file_arr['file_name'],
'file_size' => $file_arr['file_size'],
'fv' => $file_arr['fv'],
'tv' => $file_arr['tv'],
'type' => $file_arr['type'],
'note' => json_encode($note, JSON_UNESCAPED_UNICODE),
'published_first' => $pubFirst,
@ -90,6 +93,8 @@ class SQLiteWriter
'file_name' => $g->filename,
'file_size' => $g->file_size,
'type' => $g->type,
'fv' => $g->fv,
'tv' => $g->tv,
'note' => array(
'en' => $g->description_en,
'ja' => $g->description_ja,
@ -98,8 +103,6 @@ class SQLiteWriter
'pubDate' => $g->time,
));
$ok = $this->insertArray('updates', array(
'tv' => $g->tv,
'fv' => $g->fv,
'svn' => $g->svn,
'pubDate' => $g->time,
'publisher' => $g->publisher,