mirror of
https://github.com/go-shiori/shiori.git
synced 2025-01-16 04:48:30 +08:00
Make SQLite database compatible with old version
This commit is contained in:
parent
2b9e225d68
commit
6b39742a35
2 changed files with 4 additions and 1 deletions
|
@ -73,6 +73,9 @@ func OpenSQLiteDatabase(databasePath string) (sqliteDB *SQLiteDatabase, err erro
|
||||||
|
|
||||||
tx.MustExec(`CREATE VIRTUAL TABLE IF NOT EXISTS bookmark_content USING fts4(title, content, html)`)
|
tx.MustExec(`CREATE VIRTUAL TABLE IF NOT EXISTS bookmark_content USING fts4(title, content, html)`)
|
||||||
|
|
||||||
|
// Alter table if needed
|
||||||
|
tx.Exec(`ALTER TABLE account ADD COLUMN owner INTEGER NOT NULL DEFAULT 0`)
|
||||||
|
|
||||||
err = tx.Commit()
|
err = tx.Commit()
|
||||||
checkError(err)
|
checkError(err)
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@ type Bookmark struct {
|
||||||
Modified string `db:"modified" json:"modified"`
|
Modified string `db:"modified" json:"modified"`
|
||||||
Content string `db:"content" json:"-"`
|
Content string `db:"content" json:"-"`
|
||||||
HTML string `db:"html" json:"html,omitempty"`
|
HTML string `db:"html" json:"html,omitempty"`
|
||||||
|
ImageURL string `db:"image_url" json:"imageURL"`
|
||||||
HasContent bool `db:"has_content" json:"hasContent"`
|
HasContent bool `db:"has_content" json:"hasContent"`
|
||||||
HasArchive bool `json:"hasArchive"`
|
HasArchive bool `json:"hasArchive"`
|
||||||
ImageURL string `json:"imageURL"`
|
|
||||||
Tags []Tag `json:"tags"`
|
Tags []Tag `json:"tags"`
|
||||||
CreateArchive bool `json:"createArchive"`
|
CreateArchive bool `json:"createArchive"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue