2020-04-22 22:15:21 +02:00
|
|
|
"""empty message
|
|
|
|
|
2020-05-17 22:59:12 +02:00
|
|
|
Revision ID: af001b07177d
|
2020-04-22 22:15:21 +02:00
|
|
|
Revises:
|
2020-05-17 22:59:12 +02:00
|
|
|
Create Date: 2020-05-16 13:53:02.747714
|
2020-04-22 22:15:21 +02:00
|
|
|
|
|
|
|
"""
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
2020-05-17 22:59:12 +02:00
|
|
|
revision = 'af001b07177d'
|
2020-04-22 22:15:21 +02:00
|
|
|
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',
|
2020-05-17 22:59:12 +02:00
|
|
|
sa.Column('id', sa.String(length=64), nullable=False),
|
2020-04-22 22:15:21 +02:00
|
|
|
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),
|
2020-05-17 22:59:12 +02:00
|
|
|
sa.Column('calendarJson', sa.String(), nullable=True),
|
|
|
|
sa.Column('google_credentials', sa.String(), nullable=True),
|
2020-04-22 22:15:21 +02:00
|
|
|
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 ###
|