4.21.3
This commit is contained in:
36
app/migrations/versions/2021_081718_d4392342465f_.py
Normal file
36
app/migrations/versions/2021_081718_d4392342465f_.py
Normal file
@ -0,0 +1,36 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: d4392342465f
|
||||
Revises: 9014cca7097c
|
||||
Create Date: 2021-08-17 18:53:27.134187
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'd4392342465f'
|
||||
down_revision = '9014cca7097c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('custom_domain', sa.Column('ownership_txt_token', sa.String(length=128), nullable=True))
|
||||
op.add_column('custom_domain', sa.Column('ownership_verified', sa.Boolean(), server_default='0', nullable=False))
|
||||
op.create_index('ix_unique_domain', 'custom_domain', ['domain'], unique=True,
|
||||
postgresql_where=sa.text('ownership_verified'))
|
||||
|
||||
# set ownership_verified=True for domain that has verified=True
|
||||
op.execute('UPDATE custom_domain SET ownership_verified = true WHERE verified = true')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index('ix_unique_domain', table_name='custom_domain')
|
||||
op.drop_column('custom_domain', 'ownership_verified')
|
||||
op.drop_column('custom_domain', 'ownership_txt_token')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user