45 lines
1.8 KiB
Python
45 lines
1.8 KiB
Python
|
|
"""model mixins
|
||
|
|
|
||
|
|
Revision ID: 661202797ecd
|
||
|
|
Revises: 869d48618a1c
|
||
|
|
Create Date: 2026-06-22 13:29:39.689067
|
||
|
|
|
||
|
|
"""
|
||
|
|
from typing import Sequence, Union
|
||
|
|
|
||
|
|
from alembic import op
|
||
|
|
import sqlalchemy as sa
|
||
|
|
|
||
|
|
|
||
|
|
# revision identifiers, used by Alembic.
|
||
|
|
revision: str = '661202797ecd'
|
||
|
|
down_revision: Union[str, Sequence[str], None] = '869d48618a1c'
|
||
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
||
|
|
depends_on: Union[str, Sequence[str], None] = None
|
||
|
|
|
||
|
|
|
||
|
|
def upgrade() -> None:
|
||
|
|
"""Upgrade schema."""
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.add_column('organisation', sa.Column('created_at', sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()))
|
||
|
|
op.add_column('organisation', sa.Column('updated_at', sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()))
|
||
|
|
op.add_column('organisation', sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True))
|
||
|
|
op.add_column('user', sa.Column('active', sa.Boolean(), nullable=False, server_default=sa.false()))
|
||
|
|
op.add_column('user', sa.Column('created_at', sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()))
|
||
|
|
op.add_column('user', sa.Column('updated_at', sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()))
|
||
|
|
op.add_column('user', sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True))
|
||
|
|
# ### end Alembic commands ###
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade() -> None:
|
||
|
|
"""Downgrade schema."""
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.drop_column('user', 'deleted_at')
|
||
|
|
op.drop_column('user', 'updated_at')
|
||
|
|
op.drop_column('user', 'created_at')
|
||
|
|
op.drop_column('user', 'active')
|
||
|
|
op.drop_column('organisation', 'deleted_at')
|
||
|
|
op.drop_column('organisation', 'updated_at')
|
||
|
|
op.drop_column('organisation', 'created_at')
|
||
|
|
# ### end Alembic commands ###
|