redash/migrations/0001_allow_delete_query.py

16 lines
380 B
Python
Raw Normal View History

from playhouse.migrate import PostgresqlMigrator, migrate
from redash.models import db
2014-05-09 17:14:30 +00:00
from redash import models
if __name__ == '__main__':
db.connect_db()
migrator = PostgresqlMigrator(db.database)
2014-05-09 17:14:30 +00:00
with db.database.transaction():
migrate(
migrator.add_column('queries', 'is_archived', models.Query.is_archived)
)
2014-05-09 17:14:30 +00:00
db.close_db(None)