Skip to content

Apply all migrations from scratch on the test database #1401

Discussion options

You must be logged in to vote

I created all my tables in the public schema

that's the default for PostgreSQL, if you omit the schema entirely (which is what I recommend), "public" is where they will go.

(I tried to put the in another specific schema but it became a nightmare for Alembic so I switched back to public)

Alembic supports this but let's start small.

using __table_args__: dict = {'schema': 'public'}.

OK remove that. public is the default schema. re-stating it confuses SQLAlchemy and Alembic. See https://docs.sqlalchemy.org/en/20/dialects/postgresql.html#remote-schema-table-introspection-and-postgresql-search-path .

Overall, if your PG search path is left at its default of "public", and you omit the wor…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Timelessprod
Comment options

Comment options

You must be logged in to vote
2 replies
@Timelessprod
Comment options

@zzzeek
Comment options

Answer selected by Timelessprod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants