- Fix migration of shelf order
- fix show random books in detail view for authors and series
This commit is contained in:
OzzieIsaacs
2017-02-02 19:36:31 +01:00
parent f21c65ac50
commit 176c7dce70
9 changed files with 23 additions and 13 deletions

View File

@ -330,6 +330,13 @@ def migrate_Database():
conn.execute("ALTER TABLE Settings ADD column `config_anonbrowse` SmallInteger DEFAULT 0")
conn.execute("ALTER TABLE Settings ADD column `config_public_reg` SmallInteger DEFAULT 0")
session.commit()
try:
session.query(exists().where(BookShelf.order)).scalar()
session.commit()
except exc.OperationalError: # Database is not compatible, some rows are missing
conn = engine.connect()
conn.execute("ALTER TABLE book_shelf_link ADD column 'order' INTEGER DEFAULT 1")
session.commit()
try:
create = False
session.query(exists().where(User.sidebar_view)).scalar()