f6ff0d6ca0
This change ensures that the tables in the database during migration have at least one row of "real" data, which should help catch issues in the future where we forget to set column defaults and other such schema oversights that can only be truly tested with non-empty tables Fixes https://jira.coreos.com/browse/QUAY-913
27 lines
700 B
Python
27 lines
700 B
Python
"""Add user location field
|
|
|
|
Revision ID: cbc8177760d9
|
|
Revises: 7367229b38d9
|
|
Create Date: 2018-02-02 17:39:16.589623
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'cbc8177760d9'
|
|
down_revision = '7367229b38d9'
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import mysql
|
|
from util.migrate import UTF8CharField
|
|
|
|
def upgrade(tables, tester):
|
|
op.add_column('user', sa.Column('location', UTF8CharField(length=255), nullable=True))
|
|
|
|
# ### population of test data ### #
|
|
tester.populate_column('user', 'location', tester.TestDataType.UTF8Char)
|
|
# ### end population of test data ### #
|
|
|
|
|
|
def downgrade(tables, tester):
|
|
op.drop_column('user', 'location')
|