Support migrations with multiple statements (batch)
See original GitHub issueIssue Description
It would be great if a single migration file could contain multiple statements.
I tried to create 2 tables in a migration file, but this seems not to be supported. The migration failed with this error:
com.datastax.driver.core.exceptions.SyntaxError: line 9:0 missing EOF at 'CREATE'
at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:35) ~[cassandra-driver-core-2.0.1.jar:na]
at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:256) ~[cassandra-driver-core-2.0.1.jar:na]
at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:172) ~[cassandra-driver-core-2.0.1.jar:na]
at com.datastax.driver.core.SessionManager.execute(SessionManager.java:91) ~[cassandra-driver-core-2.0.1.jar:na]
at com.datastax.driver.core.SessionManager.execute(SessionManager.java:83) ~[cassandra-driver-core-2.0.1.jar:na]
at com.streamsend.pillar.Migration$class.executeUpStatement(Migration.scala:38) ~[pillar_2.10-1.0.3.jar:1.0.3]
Looking at the Parser
and Migration
classes it seems obvious that it’s just not supported.
To support this (without really parsing cql) perhaps a pragmatic/simple solution would be to use some statement separator, like e.g. a line only containing --
with an empty line above/below or s.th. like this.
What do you think?
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Multiple Batches in SQL Server Migration Script
I've done some research and found that SSMS allows the use of the GO keyword to separate batches, but every time I try...
Read more >Manage migration batches in Exchange Online - Microsoft Learn
Create a new migration batch. Use this command to migrate on-premises mailboxes to Microsoft 365 or Office 365 (also called onboarding) or to...
Read more >Batch - Flyway by Redgate • Database Migrations Made Easy.
This is supported for INSERT, UPDATE, DELETE, MERGE, and UPSERT statements. All other statements are automatically executed without batching.
Read more >Batch updates for SQL statements · Issue #94 · flyway ... - GitHub
In short, current implementation sends statements to DB one by one which results in very slow updates (in case of large files and...
Read more >Use DMS batch apply feature to improve CDC replication ...
I'm running a full load and a change data capture (CDC) AWS Database Migration Service (AWS DMS) task. The source latency isn't high, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Still missing this. Unfortunately github doesn’t allow to reopen issues for non project owners 😕
The original design goal was to promote simple migrations, encouraging developers to write migrations that do one thing. I think that’s still feasible. So I’ll close this issue.
I’m not completely opposed to the idea of introducing a more sophisticated parser. However, like @pvenable, I don’t have a need for it.