Spaces:
Sleeping
Sleeping
"""default_timezone | |
Revision ID: 7ea44cbc5b1f | |
Revises: 8feaedca36f9 | |
Create Date: 2024-06-02 14:36:01.552518 | |
""" | |
from typing import Sequence, Union | |
from alembic import op | |
import sqlalchemy as sa | |
from sqlalchemy.dialects import postgresql | |
# revision identifiers, used by Alembic. | |
revision: str = "7ea44cbc5b1f" | |
down_revision: Union[str, None] = "8feaedca36f9" | |
branch_labels: Union[str, Sequence[str], None] = None | |
depends_on: Union[str, Sequence[str], None] = None | |
def upgrade() -> None: | |
# ### commands auto generated by Alembic - please adjust! ### | |
op.alter_column( | |
"transactions", | |
"created_at", | |
existing_type=postgresql.TIMESTAMP(), | |
type_=sa.DateTime(timezone=True), | |
nullable=False, | |
) | |
op.alter_column( | |
"transactions", | |
"updated_at", | |
existing_type=postgresql.TIMESTAMP(), | |
type_=sa.DateTime(timezone=True), | |
nullable=False, | |
) | |
op.alter_column( | |
"users", "created_at", existing_type=postgresql.TIMESTAMP(), type_=sa.DateTime(timezone=True), nullable=False | |
) | |
op.alter_column( | |
"users", "updated_at", existing_type=postgresql.TIMESTAMP(), type_=sa.DateTime(timezone=True), nullable=False | |
) | |
# ### end Alembic commands ### | |
def downgrade() -> None: | |
# ### commands auto generated by Alembic - please adjust! ### | |
op.alter_column( | |
"users", "updated_at", existing_type=sa.DateTime(timezone=True), type_=postgresql.TIMESTAMP(), nullable=True | |
) | |
op.alter_column( | |
"users", "created_at", existing_type=sa.DateTime(timezone=True), type_=postgresql.TIMESTAMP(), nullable=True | |
) | |
op.alter_column( | |
"transactions", | |
"updated_at", | |
existing_type=sa.DateTime(timezone=True), | |
type_=postgresql.TIMESTAMP(), | |
nullable=True, | |
) | |
op.alter_column( | |
"transactions", | |
"created_at", | |
existing_type=sa.DateTime(timezone=True), | |
type_=postgresql.TIMESTAMP(), | |
nullable=True, | |
) | |
# ### end Alembic commands ### | |