sqlalchemy / sqlalchemy/alembic

document what include_schemas does and include notes about the significance of default schema name

Open
#729 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

autogenerate - detection question
Dominant language
Python
Stars
4.4k
Forks
375
PR merge metrics
No merged PRs in 30d

Description

I am using MSSQL.

For each "dbo" table I have a mirrored design for a "stage" table.

Due to the workflow I have, I bulk insert data into a "stage" table and then trigger a merge process on sql server wrapped in a stored procedure I call from sqlalchemy.

Everything is working good but the schema migrations continuously detect changes in the foreign keys - generating stuff that shouldn't be generated after the initial migration.

I read a bunch of forums and the workarounds seem a little dated and really complex. I was curious is there is a better way to work with schema migrations?

What I have done is just use all dbo schema and attach "stage" to the end of the stage table name. I'd prefer to have two schemas but I struggle to understand the workaround.

https://groups.google.com/forum/#!topic/sqlalchemy-alembic/FA8wpmPJc7U

https://stackoverflow.com/questions/41150956/alembic-not-generating-correct-changes/41193382#41193382

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing documentation for include_schemas and the default schema name. Document what include_schemas does and explain why the default schema name matters, including the schema-migration context described in the issue; done when a reader can understand these options without relying on external forum posts.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlalchemy
Domain
databases, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.