How to use Alembic with Postgres? #1501
Replies: 3 comments 1 reply
-
Okay, another tutorial: https://medium.com/@johnidouglasmarangon/using-migrations-in-python-sqlalchemy-with-alembic-docker-solution-bd79b219d6a seems to work. But, why I got the migration: """empty message
Revision ID: 0b1d71871aa2
Revises:
Create Date: 2024-07-07 12:06:32.045538
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '0b1d71871aa2'
down_revision: Union[str, None] = None
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.drop_table('alembic_version')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('alembic_version',
sa.Column('version_num', sa.VARCHAR(length=32), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('version_num', name='alembic_version_pkc')
)
# ### end Alembic commands ###
UPDATE: question 2 solved |
Beta Was this translation helpful? Give feedback.
-
after some mangling with
It works now, but still, what is a proper way to do it? I'm confused a little bit |
Beta Was this translation helpful? Give feedback.
-
Hi, You seem to have a strange setup regarding the postgresql |
Beta Was this translation helpful? Give feedback.
-
This drives me crazy, I tried several tutorials, but it doesn't work.
None of the commands work, I get this error:
схема для создания объектов не выбрана
meansschema for creating objects is not chosen
.What should I do?
Beta Was this translation helpful? Give feedback.
All reactions