-
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 #37 from wafflestudio/change_pw
비밀번호 암호화 및 변경 기능 추가
- Loading branch information
Showing
9 changed files
with
219 additions
and
17 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
46 changes: 46 additions & 0 deletions
46
.../alembic/versions/2025_01_23_2311-49abd7e4c043_user_db에서_password를_hashed_password로_교체.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,46 @@ | ||
"""User DB에서 password를 hashed_password로 교체 | ||
Revision ID: 49abd7e4c043 | ||
Revises: 9e2715d6e171 | ||
Create Date: 2025-01-23 23:11:56.190187 | ||
""" | ||
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 = '49abd7e4c043' | ||
down_revision: Union[str, None] = '9e2715d6e171' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
|
||
# password Column을 hashed_password로 교체 | ||
op.alter_column( | ||
'user', # table name | ||
'password', # original column name | ||
new_column_name='hashed_password', | ||
type_=sa.String(60), | ||
existing_type=sa.String(20), | ||
existing_nullable=False | ||
) | ||
|
||
# 기존 회원들의 hashed_password를 특정값으로 교체 | ||
# op.execute( | ||
# "UPDATE user SET hashed_password = 'hashed_password' ") | ||
|
||
|
||
def downgrade() -> None: | ||
op.alter_column( | ||
'user', | ||
'hashed_password', | ||
new_column_name = 'password', | ||
type = sa.String(20), | ||
existing_type = sa.String(60), | ||
existing_nullable = False | ||
) |
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