-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: revert and update migrations with '_at' for date columns
- Loading branch information
Showing
5 changed files
with
40 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
src/backend/app/migrations/versions/832089d4a1de_deadline_for_projects.py
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/backend/app/migrations/versions/acee47666167_refine_field_name.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""refine field name | ||
Revision ID: acee47666167 | ||
Revises: 88ae62ec8876 | ||
Create Date: 2024-07-13 10:51:33.020864 | ||
""" | ||
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 = 'acee47666167' | ||
down_revision: Union[str, None] = '88ae62ec8876' | ||
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.add_column('projects', sa.Column('created_at', sa.DateTime(), nullable=False)) | ||
op.add_column('projects', sa.Column('deadline_at', sa.DateTime(), nullable=True)) | ||
op.drop_column('projects', 'created') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
#op.add_column('projects', sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=False)) | ||
op.drop_column('projects', 'deadline_at') | ||
op.drop_column('projects', 'created_at') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters