calendarwatch_frontend/migrations/versions/af001b07177d_.py
Raphael Maenle ee54dd5daa updates color generation, tries fixing credentials bug
- credentials still lost the refresh token after a certain event
  - this was now fixed by completely removing any saves past the first one
  - https://trello.com/c/iORYLYHl/44-1-check-on-credentials

- Color Coding is now updated
  - fixed an incorrect color mapping in the colors.json
  - updates some calls to functions to correctly get the natural colors
  - the incorrect red -> yellow mapping might have to do with the previous credentials error
2020-05-17 22:59:12 +02:00

55 lines
2.0 KiB
Python

"""empty message
Revision ID: af001b07177d
Revises:
Create Date: 2020-05-16 13:53:02.747714
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'af001b07177d'
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=64), 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.Column('calendarJson', sa.String(), nullable=True),
sa.Column('google_credentials', sa.String(), 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 ###