tofu-api/migrations/versions/2022_04_15_2141-044f3afd19b...

39 lines
1.1 KiB
Python

"""
Initial revision
Revision ID: 044f3afd19b0
Revises:
Create Date: 2022-04-15 21:41:39.962542+02:00
"""
from alembic import op
import sqlalchemy as sa
import tofu_api.common.database.types as tofu_types
# Revision identifiers, used by Alembic.
revision = '044f3afd19b0'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
'task',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', tofu_types.TzDateTime(), server_default=sa.text('now()'), nullable=False),
sa.Column('modified_at', tofu_types.TzDateTime(), server_default=sa.text('now()'), nullable=False),
sa.Column('title', sa.String(length=255), nullable=False),
sa.Column('description', sa.Text(), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_task'))
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('task')
# ### end Alembic commands ###