Make SQLite database compatible with old version

This commit is contained in:
Radhi Fadlillah 2019-08-22 14:27:38 +07:00
parent 2b9e225d68
commit 6b39742a35
2 changed files with 4 additions and 1 deletions

View File

@ -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)`)
// Alter table if needed
tx.Exec(`ALTER TABLE account ADD COLUMN owner INTEGER NOT NULL DEFAULT 0`)
err = tx.Commit()
checkError(err)

View File

@ -19,9 +19,9 @@ type Bookmark struct {
Modified string `db:"modified" json:"modified"`
Content string `db:"content" json:"-"`
HTML string `db:"html" json:"html,omitempty"`
ImageURL string `db:"image_url" json:"imageURL"`
HasContent bool `db:"has_content" json:"hasContent"`
HasArchive bool `json:"hasArchive"`
ImageURL string `json:"imageURL"`
Tags []Tag `json:"tags"`
CreateArchive bool `json:"createArchive"`
}