Comments (4)
@codahale just to confirm, are you talking about running multiple different migrations inside a single transaction, or running a single migration inside a transaction?
from ragtime.
Sorry if I wasn't clear; I meant running all of the statements of a individual migration in a single, per-migration transaction.
I think it should be as simple as wrapping execute-sql! in a transaction, but it's possible some databases which don't support transactional DDL may throw an exception.
from ragtime.
Is it possible to do this already with the current SQL migration support? I'm guessing this is the kind of thing you've already tried, but it doesn't work because each command is sent separately (hence this issue)?:
{:up ["BEGIN"
"CREATE TABLE foo (name VARCHAR(100))"
"INSERT INTO foo VALUES ('alice'), ('bob')"
"COMMIT"]
:down ["DROP TABLE foo"]}
from ragtime.
I actually hadn't thought of that, but I can run transactional DDLs inside migration statements. Thanks for pointing that out; that totally solves my problem. I'll go ahead and close the issue.
from ragtime.
Related Issues (20)
- Migrations in multiple schemas do not work if migrations-table is not schema qualified
- CLJ migrations
- Checking for pending migrations HOT 11
- Migration strategy for continuous delivery HOT 3
- Catch and rethrow exceptions during migrations with more context? HOT 1
- Allow migrations to be clojure function instead on just sql HOT 2
- ragtime.strategy/ignore-future doesn't exist in the newest version 0.7.2 HOT 1
- Add clean option to rollback all migrations HOT 4
- Abstract out jdbc project HOT 8
- Read error on wildfly HOT 2
- illegal
- WARNING: An illegal reflective access operation has occurred HOT 3
- get-table-metadata* leaks a ResultSet
- Migration conflict on app restart HOT 2
- Throw more actionable "Conflict" exceptions?
- Upgrade ragtime.jdbc to use next-jdbc HOT 1
- next-jdbc: Discover that the migration table exists even if the name is quoted
- Make a new release with the support for quoted identifiers HOT 2
- No such var: next.jdbc.default-options/wrapped-connection? HOT 11
- Ragtime tries to run same migrations twice on Ubuntu 22.04 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 ragtime.