-
Notifications
You must be signed in to change notification settings - Fork 133
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 #831 from hngprojects/dev
chore: merging 'dev' into staging
- Loading branch information
Showing
53 changed files
with
1,919 additions
and
1,065 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""empty message | ||
Revision ID: 299ab5d402fc | ||
Revises: 224b03e9169c, 44f7da26ee88 | ||
Create Date: 2024-08-08 18:59:46.314362 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '299ab5d402fc' | ||
down_revision: Union[str, None] = ('224b03e9169c', '44f7da26ee88') | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
pass | ||
|
||
|
||
def downgrade() -> None: | ||
pass |
30 changes: 30 additions & 0 deletions
30
alembic/versions/44f7da26ee88_ensure_id_and_foreign_keys_are_of_type_.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,30 @@ | ||
"""Ensure id and foreign keys are of type String | ||
Revision ID: 44f7da26ee88 | ||
Revises: b27028b0327e | ||
Create Date: 2024-08-08 18:21:40.759920 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '44f7da26ee88' | ||
down_revision: Union[str, None] = 'b27028b0327e' | ||
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! ### | ||
pass | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
# ### end Alembic commands ### |
38 changes: 38 additions & 0 deletions
38
alembic/versions/b27028b0327e_ensure_id_and_foreign_keys_are_of_type_.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,38 @@ | ||
"""Ensure id and foreign keys are of type String | ||
Revision ID: b27028b0327e | ||
Revises: 8caa1a06240c | ||
Create Date: 2024-08-08 17:49:49.925575 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'b27028b0327e' | ||
down_revision: Union[str, None] = '8caa1a06240c' | ||
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('permissions', sa.Column('title', sa.String(), nullable=False)) | ||
op.drop_constraint('permissions_name_key', 'permissions', type_='unique') | ||
op.create_unique_constraint(None, 'permissions', ['title']) | ||
op.drop_column('permissions', 'name') | ||
op.add_column('roles', sa.Column('description', sa.Text(), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('roles', 'description') | ||
op.add_column('permissions', sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False)) | ||
op.drop_constraint(None, 'permissions', type_='unique') | ||
op.create_unique_constraint('permissions_name_key', 'permissions', ['name']) | ||
op.drop_column('permissions', 'title') | ||
# ### end Alembic commands ### |
32 changes: 32 additions & 0 deletions
32
alembic/versions/ff92a0037698_ensure_id_and_foreign_keys_are_of_type_.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,32 @@ | ||
"""Ensure id and foreign keys are of type String | ||
Revision ID: ff92a0037698 | ||
Revises: 299ab5d402fc | ||
Create Date: 2024-08-08 19:03:17.115224 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'ff92a0037698' | ||
down_revision: Union[str, None] = '299ab5d402fc' | ||
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('product_comments', sa.Column('user_id', sa.String(), nullable=True)) | ||
op.create_foreign_key(None, 'product_comments', 'users', ['user_id'], ['id'], ondelete='SET NULL') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, 'product_comments', type_='foreignkey') | ||
op.drop_column('product_comments', 'user_id') | ||
# ### 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
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
Oops, something went wrong.