redash/migrations/0004_allow_null_in_event_user.py
2015-03-12 11:43:21 +02:00

13 lines
303 B
Python

from playhouse.migrate import PostgresqlMigrator, migrate
from redash.models import db
if __name__ == '__main__':
db.connect_db()
migrator = PostgresqlMigrator(db.database)
with db.database.transaction():
migrate(
migrator.drop_not_null('events', 'user_id')
)