Skip to content
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.

Chain commands in cassandra migration file #338

Open
YannickB opened this issue Feb 16, 2018 · 1 comment
Open

Chain commands in cassandra migration file #338

YannickB opened this issue Feb 16, 2018 · 1 comment

Comments

@YannickB
Copy link

Hello,

Is it possible to chain several commands when executing a migration file for cassandra ? I have an error if I try to add something after a semi-colon.

migration failed in line 0: CREATE TABLE IF NOT EXISTS requirement ( id text, parent_id text, sequence int, computation text, weight int, state text, can_have_children boolean, PRIMARY KEY(id) ); CREATE INDEX IF NOT EXISTS requirement_parent_id ON requirement(parent_id); (details: line 11:0 mismatched input 'CREATE' expecting EOF (...PRIMARY KEY(id));[CREATE]...))

Of course I can still create one file per command but this is really not convenient. I wonder if this is a limitation of gocql, what do you think ?

Thanks!

@YannickB
Copy link
Author

I asked the question on the gocql project (link above). It seems this is a cassandra limitation, the only way seems to find a way to split the statement and execute them separately. Maybe a strings.Split(file, ";") will do the trick ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant