Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Commit

Permalink
Moving new table definition into migration section
Browse files Browse the repository at this point in the history
This ensures that upgrades from existing databases will be seamless
  • Loading branch information
mintsoft committed Dec 11, 2015
1 parent ece555c commit 8ad7617
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions resources/data/models/Catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ def __init__(self, database_path):
CREATE TABLE cache_status (
etag TEXT
) ''')
database.execute('''
CREATE TABLE cookies (
cookieblob TEXT
)''')
database.execute('''
CREATE TABLE auth (
token TEXT
Expand Down Expand Up @@ -127,6 +123,12 @@ def __init__(self, database_path):
database.commit()
else:
database = sqlite3.connect(database_path)
# Deviations from the original schema should be
# defined here so that upgrades will work correctly
database.execute('''
CREATE TABLE IF NOT EXISTS cookies (
cookieblob TEXT
)''')

database.row_factory = sqlite3.Row
self.database = database
Expand Down

0 comments on commit 8ad7617

Please sign in to comment.