mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 17:15:17 +00:00
17 lines
547 B
Python
17 lines
547 B
Python
from redash.models import db, NotificationDestination, AlertSubscription
|
|
from playhouse.migrate import PostgresqlMigrator, migrate
|
|
|
|
if __name__ == '__main__':
|
|
migrator = PostgresqlMigrator(db.database)
|
|
with db.database.transaction():
|
|
|
|
if not NotificationDestination.table_exists():
|
|
NotificationDestination.create_table()
|
|
|
|
# Update alert subscription fields
|
|
migrate(
|
|
migrator.add_column('alert_subscriptions', 'destination_id', AlertSubscription.destination)
|
|
)
|
|
|
|
db.close_db(None)
|