mirror of
https://github.com/simple-login/app.git
synced 2025-02-22 23:02:55 +08:00
migration script
This commit is contained in:
parent
c6eba9f125
commit
fead5efc8b
1 changed files with 31 additions and 0 deletions
31
migrations/versions/2020_091211_b0e9a389939a_.py
Normal file
31
migrations/versions/2020_091211_b0e9a389939a_.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: b0e9a389939a
|
||||
Revises: 84471852b610
|
||||
Create Date: 2020-09-12 11:18:40.262432
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b0e9a389939a'
|
||||
down_revision = '84471852b610'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('newsletter_alias_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(None, 'users', 'alias', ['newsletter_alias_id'], ['id'], ondelete='SET NULL')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'users', type_='foreignkey')
|
||||
op.drop_column('users', 'newsletter_alias_id')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue