Open YannickB opened 6 years ago
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 ?
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!