Comments (4)
The behavior your seeing is related to not doing dependency order resolution for the alembic DropOp
When resolution order is a problem the best bet is to break the migration down into smaller chunks:
For example, you could
- drop trigger A
- autogen migration
- drop function A
- autogen migration
- create new function B and trigger B
- autogen migration
alternatively, you could continue dropping both at the same time and manually re-order the drop_entity
calls in the autogen'ed migration
Possible approaches to solving this upstream (if you'd like to submit a PR would be to update here
alembic_utils/src/alembic_utils/replaceable_entity.py
Lines 391 to 400 in fb39689
To
- Order the drops so that PGTrigger is always first (this would solve you problem but not all problems)
- Collect a list of the entities planned for dropping and then do drop order resolution before appending to
upgrade_ops
equivalent to
where either implementation would need tests like this one https://github.com/olirice/alembic_utils/blob/master/src/test/test_depends.py
from alembic_utils.
Hi .I created a fork , to solve the dependency ordering . My fork supports ordering of nested dependencies for both create and drop operation. Could you have a look?
from alembic_utils.
If you could open a PR an annotate the changes I'd be happy to take a look!
from alembic_utils.
Sure. done.
from alembic_utils.
Related Issues (20)
- How to add a function with an " text[] default array['text', 'text2']"? HOT 3
- PGExtension replace `create` with `create if not exists` HOT 4
- Must be owner of materialized view mat_view_name HOT 2
- Alembic autogenerate broken for 'internal' PG functions HOT 6
- INFO: Transaction approach incompatible with MySQL
- alembic check broken - diff cannot be rendered HOT 1
- Materialized view change detection fails if upstream view has changed HOT 6
- Publishing next release HOT 1
- alembic_utils does not work with Redshift Dialect. HOT 1
- Adapting simulate_entities() to use .begin() instead of .begin_nested() HOT 1
- Extremely slow HOT 4
- connection was closed in the middle of operation HOT 2
- Unexpected white space inclusion in signature (Pg error: function ... does not exist) HOT 1
- Is it possible to create PGTrigger in all the table by expanding declarative_base? HOT 3
- Document the equivilent of HOT 1
- Getting error permission denied on alembic_version when try to migrate. HOT 1
- feat: Type info HOT 5
- feat: Fix pyright linting HOT 1
- Grant without defining columns HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alembic_utils.