Implement BaseModel class, TimestampMixin, TzDateTime type; cleanup Task model
This commit is contained in:
parent
7ce43a2bfe
commit
252c15acbd
15 changed files with 223 additions and 42 deletions
|
|
@ -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 ###
|
||||
Loading…
Add table
Add a link
Reference in a new issue