-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from wafflestudio/create_comment
create_comment API 추가
- Loading branch information
Showing
7 changed files
with
146 additions
and
11 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
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
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
48 changes: 48 additions & 0 deletions
48
...tabase/alembic/versions/2025_01_13_2234-4fa11f1eada9_comment에_edit_관련_필드_추가하고_created_.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,48 @@ | ||
"""Comment에 edit 관련 필드 추가하고, created_datetime과 edited_datetime Timestamp로 변경 | ||
Revision ID: 4fa11f1eada9 | ||
Revises: 0a5a02cfb40b | ||
Create Date: 2025-01-13 22:34:30.920243 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '4fa11f1eada9' | ||
down_revision: Union[str, None] = '0a5a02cfb40b' | ||
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('comment', sa.Column('is_edited', sa.Boolean(), nullable=False)) | ||
op.add_column('comment', sa.Column('edited_datetime', sa.DateTime(timezone=True), nullable=True)) | ||
op.alter_column('vote', 'create_datetime', | ||
existing_type=mysql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=False) | ||
op.alter_column('vote', 'end_datetime', | ||
existing_type=mysql.TIMESTAMP(), | ||
type_=sa.DateTime(timezone=True), | ||
existing_nullable=False) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('vote', 'end_datetime', | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=mysql.TIMESTAMP(), | ||
existing_nullable=False) | ||
op.alter_column('vote', 'create_datetime', | ||
existing_type=sa.DateTime(timezone=True), | ||
type_=mysql.TIMESTAMP(), | ||
existing_nullable=False) | ||
op.drop_column('comment', 'edited_datetime') | ||
op.drop_column('comment', 'is_edited') | ||
# ### 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