<reponame>shvms/match-recommendation-service
"""add users & tracks tables

Revision ID: 738cfae4ba0d
Revises: 1011cbf0<PASSWORD>
Create Date: 2021-04-28 02:33:47.012820

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '738cfae4ba0d'
down_revision = '1011cbf0<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('gender', sa.Enum('female', 'male', 'non_binary', name='gender_enum'), nullable=False),
    sa.Column('dob', sa.Date(), nullable=False),
    sa.Column('pref_interested_in', sa.Enum('female', 'male', 'everyone', name='pref_interested_in_enum'), nullable=False),
    sa.Column('registered_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_users_id'), 'users', ['id'], unique=False)
    op.create_table('tracks',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('track', sa.String(length=40), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('tracks')
    op.drop_index(op.f('ix_users_id'), table_name='users')
    op.drop_table('users')
    # ### end Alembic commands ###

"""add users & tracks tables

Revision ID: 738cfae4ba0d
Revises: 1011cbf0<PASSWORD>
Create Date: 2021-04-28 02:33:47.012820

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '738cfae4ba0d'
down_revision = '1011cbf0<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('gender', sa.Enum('female', 'male', 'non_binary', name='gender_enum'), nullable=False),
    sa.Column('dob', sa.Date(), nullable=False),
    sa.Column('pref_interested_in', sa.Enum('female', 'male', 'everyone', name='pref_interested_in_enum'), nullable=False),
    sa.Column('registered_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_users_id'), 'users', ['id'], unique=False)
    op.create_table('tracks',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('track', sa.String(length=40), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('tracks')
    op.drop_index(op.f('ix_users_id'), table_name='users')
    op.drop_table('users')
    # ### end Alembic commands ###
add users & tracks tables  Revision ID: 738cfae4ba0d Revises: 1011cbf0<PASSWORD> Create Date: 2021-04-28 02:33:47.012820 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###