Add server defaults to the new fields which are not nullable.
This commit is contained in:
parent
2ce6e76d9d
commit
579d900ef2
1 changed files with 2 additions and 2 deletions
|
@ -17,11 +17,11 @@ import sqlalchemy as sa
|
||||||
def upgrade(tables):
|
def upgrade(tables):
|
||||||
### commands auto generated by Alembic - please adjust! ###
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
op.add_column('repositorytag', sa.Column('lifetime_end_ts', sa.Integer(), nullable=True))
|
op.add_column('repositorytag', sa.Column('lifetime_end_ts', sa.Integer(), nullable=True))
|
||||||
op.add_column('repositorytag', sa.Column('lifetime_start_ts', sa.Integer(), nullable=False))
|
op.add_column('repositorytag', sa.Column('lifetime_start_ts', sa.Integer(), nullable=False, server_default="0"))
|
||||||
op.create_index('repositorytag_lifetime_end_ts', 'repositorytag', ['lifetime_end_ts'], unique=False)
|
op.create_index('repositorytag_lifetime_end_ts', 'repositorytag', ['lifetime_end_ts'], unique=False)
|
||||||
op.drop_index('repositorytag_repository_id_name', table_name='repositorytag')
|
op.drop_index('repositorytag_repository_id_name', table_name='repositorytag')
|
||||||
op.create_index('repositorytag_repository_id_name', 'repositorytag', ['repository_id', 'name'], unique=False)
|
op.create_index('repositorytag_repository_id_name', 'repositorytag', ['repository_id', 'name'], unique=False)
|
||||||
op.add_column('user', sa.Column('removed_tag_expiration_s', sa.Integer(), nullable=False))
|
op.add_column('user', sa.Column('removed_tag_expiration_s', sa.Integer(), nullable=False, server_default="1209600"))
|
||||||
### end Alembic commands ###
|
### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue