"""empty message

Revision ID: beb7a5d18720
Revises: 
Create Date: 2020-12-12 14:03:37.020284

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'beb<PASSWORD>'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.PrimaryKeyConstraint('user_id'),
    sa.UniqueConstraint('user_id')
    )
    op.create_table('message',
    sa.Column('message_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('message_text', sa.String(), nullable=False),
    sa.Column('sender_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('receiver_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.ForeignKeyConstraint(['receiver_id'], ['user.user_id'], ),
    sa.ForeignKeyConstraint(['sender_id'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('message_id'),
    sa.UniqueConstraint('message_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('message')
    op.drop_table('user')
    # ### end Alembic commands ###

"""empty message

Revision ID: beb7a5d18720
Revises: 
Create Date: 2020-12-12 14:03:37.020284

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'beb<PASSWORD>'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.PrimaryKeyConstraint('user_id'),
    sa.UniqueConstraint('user_id')
    )
    op.create_table('message',
    sa.Column('message_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('message_text', sa.String(), nullable=False),
    sa.Column('sender_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('receiver_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.ForeignKeyConstraint(['receiver_id'], ['user.user_id'], ),
    sa.ForeignKeyConstraint(['sender_id'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('message_id'),
    sa.UniqueConstraint('message_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('message')
    op.drop_table('user')
    # ### end Alembic commands ###

empty message  Revision ID: beb7a5d18720 Revises:  Create Date: 2020-12-12 14:03:37.020284 # 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 ###