Implement BaseModel class, TimestampMixin, TzDateTime type; cleanup Task model

This commit is contained in:
Lexi / Zoe 2022-04-15 21:45:10 +02:00
parent 7ce43a2bfe
commit 252c15acbd
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
15 changed files with 223 additions and 42 deletions

View file

@ -1,16 +1,18 @@
"""
Initial revision
Revision ID: 716726b4a1fe
Revision ID: 044f3afd19b0
Revises:
Create Date: 2022-04-15 16:05:29.358429+02:00
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 = '716726b4a1fe'
revision = '044f3afd19b0'
down_revision = None
branch_labels = None
depends_on = None
@ -19,16 +21,18 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
'tasks',
'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_tasks'))
sa.PrimaryKeyConstraint('id', name=op.f('pk_task'))
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('tasks')
op.drop_table('task')
# ### end Alembic commands ###