Skip to content

Commit

Permalink
Make SQLite database compatible with old version
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhiFadlillah committed Aug 22, 2019
1 parent 2b9e225 commit 6b39742
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/database/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion internal/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down

0 comments on commit 6b39742

Please sign in to comment.