Skip to content

Commit

Permalink
feat: added alembic migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Aydawka committed Oct 9, 2023
1 parent 33a9699 commit c5c1996
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
26 changes: 26 additions & 0 deletions alembic/versions/32e5ff331a78_add_token_blacklist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""add token_blacklist
Revision ID: 32e5ff331a78
Revises: 639a13561089
Create Date: 2023-10-09 11:10:06.568148
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '32e5ff331a78'
down_revision: Union[str, None] = '639a13561089'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade():
op.add_column('token_blacklist', sa.Column('user_id', sa.String, nullable=True))


def downgrade() -> None:
pass
26 changes: 26 additions & 0 deletions alembic/versions/639a13561089_delete_token_blacklist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""delete token_blacklist
Revision ID: 639a13561089
Revises: e6cc254fc968
Create Date: 2023-10-08 23:14:48.882104
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '639a13561089'
down_revision: Union[str, None] = 'e6cc254fc968'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.drop_column('token_blacklist', 'user_id')


def downgrade() -> None:
pass
26 changes: 26 additions & 0 deletions alembic/versions/6d4271d33834_remove_column_in_token_blacklist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""remove column in token_blacklist
Revision ID: 6d4271d33834
Revises: 32e5ff331a78
Create Date: 2023-10-09 11:11:58.478289
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '6d4271d33834'
down_revision: Union[str, None] = '32e5ff331a78'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.drop_column('token_blacklist', 'user_id')


def downgrade() -> None:
pass
26 changes: 26 additions & 0 deletions alembic/versions/e6cc254fc968_token_blacklist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""token_blacklist
Revision ID: e6cc254fc968
Revises: 3e48c46694c8
Create Date: 2023-10-06 19:40:38.517323
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'e6cc254fc968'
down_revision: Union[str, None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade():
op.add_column('token_blacklist', sa.Column('user_id', sa.String, nullable=True))


def downgrade() -> None:
pass

0 comments on commit c5c1996

Please sign in to comment.