Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support migrations with multiple statements (batch)

See original GitHub issue

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( ~[cassandra-driver-core-2.0.1.jar:na]
    at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException( ~[cassandra-driver-core-2.0.1.jar:na]
    at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly( ~[cassandra-driver-core-2.0.1.jar:na]
    at com.datastax.driver.core.SessionManager.execute( ~[cassandra-driver-core-2.0.1.jar:na]
    at com.datastax.driver.core.SessionManager.execute( ~[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 like this.

What do you think?

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

magrocommented, Jan 13, 2016

Still missing this. Unfortunately github doesn’t allow to reopen issues for non project owners 😕

comearacommented, Jun 10, 2014

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found