Comments (5)
Here's a diff that will allow this to happen for SQL migrations. It'll take a little more work if you're using go migrations. Use migrations w/o transaction at your own risk:
https://gist.github.com/dkoston/9b28b092424b46ad841d3a41c56c7c83
from goose.
@dkoston nice, can you submit a PR?
from goose.
@VojtechVitek sorry, we forked directly off https://bitbucket.org/liamstask/goose/src. Looks like you've made some modifications after those commits that aren't part of our internal fork. I fixed up the diff to use your directory structure but you have some code changes that will require modifications to use git apply
from goose.
Hi,
Any progress on this? In Postgres, you also cannot modify enums inside a transaction as per https://www.postgresql.org/docs/current/static/sql-altertype.html
ALTER TYPE ... ADD VALUE (the form that adds a new value to an enum type) cannot be executed inside a transaction block.
We will be doing some of these but it seems like goose can't handle these?
Can I take over this fix and create a PR to handle this case?
Thanks
from goose.
@iosdev-republicofapps PR would be greatly appreciated!
For SQL migrations, we need a flag like:
-- +goose Up transaction=false
-- +goose StatementBegin
ALTER TYPE ...; -- no transaction
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
ALTER TYPE ...; -- within a transaction
-- +goose StatementEnd
For Go migrations, we can support two function signatures:
func alterTypeUp(db *sql.DB) error {} // no transaction
func alterTypeDown(tx *sql.Tx) error {} // within a transaction
Thoughts?
from goose.
Related Issues (20)
- Formatting MigrationResults in a custom Provider HOT 10
- Switch to testcontainers-go
- Support LibSQL HOT 8
- v4 should include log output options HOT 2
- CockroachDB Support HOT 4
- goose validate does not recognize "AddMigrationContext" HOT 2
- Improving the goose CLI command HOT 2
- Split goose into separate modules (same repository) HOT 1
- Build GitHub Releases with `tinygo` HOT 2
- Compress releases with `tar.xz` and `tar.gz` HOT 4
- Add guidance for adding new dialects and integrations (CONTRIBUTING.md)
- feat: Expand Store interface; add GetLatestVersion method in Provider
- Command "goose validate" don't run HOT 1
- Make goose annotations case-insensitive
- Ydb: type casting PG<->YQL was broken in latest YDB HOT 1
- Unable to create postgres schema. HOT 2
- ENVSUB is not working HOT 7
- Migrations created with local timestamp instead of utc HOT 3
- Need advice and guidance on our case. HOT 3
- Semicolon Detection Fails for "--" in Strings in SQL Statements HOT 3
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 goose.