Initial import
This commit is contained in:
@@ -57,6 +57,11 @@ def create_app():
|
||||
db.session.execute(db.text("ALTER TABLE display ADD COLUMN description VARCHAR(200)"))
|
||||
db.session.commit()
|
||||
|
||||
# Displays: optional transition between slides (none|fade|slide)
|
||||
if "transition" not in display_cols:
|
||||
db.session.execute(db.text("ALTER TABLE display ADD COLUMN transition VARCHAR(20)"))
|
||||
db.session.commit()
|
||||
|
||||
# Companies: optional per-company storage quota
|
||||
company_cols = [
|
||||
r[1] for r in db.session.execute(db.text("PRAGMA table_info(company)")).fetchall()
|
||||
@@ -128,6 +133,22 @@ def create_app():
|
||||
)
|
||||
)
|
||||
db.session.commit()
|
||||
|
||||
# Playlists: schedule + priority flags
|
||||
playlist_cols = [
|
||||
r[1] for r in db.session.execute(db.text("PRAGMA table_info(playlist)")).fetchall()
|
||||
]
|
||||
if "schedule_start" not in playlist_cols:
|
||||
db.session.execute(db.text("ALTER TABLE playlist ADD COLUMN schedule_start DATETIME"))
|
||||
db.session.commit()
|
||||
if "schedule_end" not in playlist_cols:
|
||||
db.session.execute(db.text("ALTER TABLE playlist ADD COLUMN schedule_end DATETIME"))
|
||||
db.session.commit()
|
||||
if "is_priority" not in playlist_cols:
|
||||
db.session.execute(
|
||||
db.text("ALTER TABLE playlist ADD COLUMN is_priority BOOLEAN NOT NULL DEFAULT 0")
|
||||
)
|
||||
db.session.commit()
|
||||
except Exception:
|
||||
db.session.rollback()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user