53 lines
1.9 KiB
Python
53 lines
1.9 KiB
Python
|
"""empty message
|
||
|
|
||
|
Revision ID: 92db2e496087
|
||
|
Revises:
|
||
|
Create Date: 2020-04-20 21:33:50.061962
|
||
|
|
||
|
"""
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = '92db2e496087'
|
||
|
down_revision = None
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.create_table('calendar',
|
||
|
sa.Column('usr_id', sa.String(length=21), nullable=True),
|
||
|
sa.Column('calendar_id', sa.String(length=256), nullable=False),
|
||
|
sa.Column('name', sa.String(length=256), nullable=True),
|
||
|
sa.Column('toggle', sa.String(length=8), nullable=True),
|
||
|
sa.Column('color', sa.String(length=16), nullable=True),
|
||
|
sa.PrimaryKeyConstraint('calendar_id')
|
||
|
)
|
||
|
op.create_index(op.f('ix_calendar_name'), 'calendar', ['name'], unique=False)
|
||
|
op.create_index(op.f('ix_calendar_usr_id'), 'calendar', ['usr_id'], unique=False)
|
||
|
op.create_table('user',
|
||
|
sa.Column('id', sa.String(length=21), nullable=False),
|
||
|
sa.Column('username', sa.String(length=64), nullable=True),
|
||
|
sa.Column('email', sa.String(length=120), nullable=True),
|
||
|
sa.Column('profile_pic', sa.String(length=256), nullable=True),
|
||
|
sa.Column('password_hash', sa.String(length=128), nullable=True),
|
||
|
sa.PrimaryKeyConstraint('id')
|
||
|
)
|
||
|
op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
|
||
|
op.create_index(op.f('ix_user_username'), 'user', ['username'], unique=True)
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.drop_index(op.f('ix_user_username'), table_name='user')
|
||
|
op.drop_index(op.f('ix_user_email'), table_name='user')
|
||
|
op.drop_table('user')
|
||
|
op.drop_index(op.f('ix_calendar_usr_id'), table_name='calendar')
|
||
|
op.drop_index(op.f('ix_calendar_name'), table_name='calendar')
|
||
|
op.drop_table('calendar')
|
||
|
# ### end Alembic commands ###
|