Skip to content

Commit d9843c6

Browse files
committed
fix: changed migrations to work with postgres
1 parent 3a02a90 commit d9843c6

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

alembic.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne
5555
# are written from script.py.mako
5656
# output_encoding = utf-8
5757

58-
sqlalchemy.url =
58+
sqlalchemy.url = driver://user:pass@localhost/dbname
5959

6060

6161
[post_write_hooks]

alembic/env.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import os
99
from dotenv import load_dotenv
10-
1110
# this is the Alembic Config object, which provides
1211
# access to the values within the .ini file in use.
1312
config = context.config
@@ -27,7 +26,6 @@
2726
from app.database import Base # noqa
2827

2928
target_metadata = Base.metadata
30-
3129
# other values from the config, defined by the needs of env.py,
3230
# can be acquired:
3331
# my_important_option = config.get_main_option("my_important_option")

alembic/versions/535747a95cb5_added_users_and_request_table.py renamed to alembic/versions/2259f20dedb2_created_user_and_request_tables.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
"""Added users and request table
1+
"""created user and request tables
22
3-
Revision ID: 535747a95cb5
3+
Revision ID: 2259f20dedb2
44
Revises:
5-
Create Date: 2023-02-04 11:16:20.971541
5+
Create Date: 2023-02-04 13:32:55.290527
66
77
"""
88
from alembic import op
99
import sqlalchemy as sa
10-
10+
from sqlalchemy.dialects import postgresql
1111

1212
# revision identifiers, used by Alembic.
13-
revision = '535747a95cb5'
13+
revision = '2259f20dedb2'
1414
down_revision = None
1515
branch_labels = None
1616
depends_on = None
@@ -29,7 +29,7 @@ def upgrade() -> None:
2929
op.create_table('requests',
3030
sa.Column('id', sa.Integer(), nullable=False),
3131
sa.Column('endpoint', sa.String(), nullable=True),
32-
sa.Column('response', sa.JSON(), nullable=True),
32+
sa.Column('response', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
3333
sa.Column('owner_id', sa.Integer(), nullable=True),
3434
sa.ForeignKeyConstraint(['owner_id'], ['users.id'], ),
3535
sa.PrimaryKeyConstraint('id')

0 commit comments

Comments
 (0)