patka / cassandra-migration

Schema migration library for Cassandra
MIT License
153 stars 47 forks source link

Option to ignore certain exceptions #25

Open Glamdring opened 6 years ago

Glamdring commented 6 years ago

Cassandra does not support IF NOT EXISTS for ALTER table ADD ... queries, so it might be a good idea to be able to ignore failures in these queries.

Might be a global configuration where you specify the codes/parts of cassandra error message to be ignored.

patka commented 6 years ago

I think I came up with a solution to achieve this in the context of another pull request. I can imagine to have ErrorHandlers inside the Database instance that deal with failures. The default handling would be the current behavior but by making this a separate component, you would be able to overwrite or change parts of the behavior to match your needs. Like this you could implement a handler that ignores the errors you have in mind.

alexantonica commented 3 years ago

I've raised a PR for this #59 . It should be easily extensible to override the failure mechanism on a task.