-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SchemaAction: Support for adding/removing columns [DATACASS-187] #358
Comments
John Blum commented SD Cassandra does not currently support automatic addition/removal of columns, based on the current definition of the persistent entity associated with the table requiring an update, using a Cassandra However, it is not to difficult to imagine (or even implement for that matter) updating a table based on the current persistent entity (code) definition, especially given the admin-based template supports the All of this is to say, I think it is easily doable, though testing will be quite extensive. Currently, you could/should be able to accomplish the same thing using a It is actually this last point ("existing data") that poses a problem along with several other considerations that must be decided carefully....
NOTE: the SD Cassandra
Consider a persistent entity type (e.g. @Table("People")
class Person {
@NotNull
String firstName;
@NotNull
String lastName;
@NotNull
Timestamp birthDate;
} That would roughly translate to the following CQL DDL (assuming Cassandra has column constraints much like a RDBMS)...
Of course, in an RDBMS, constraints can be disabled while modifying the structure of a table, or defaults can be provided. But, this may not be practical in all cases.
But, to accomplish all of this, the existing table definition meta-data needs to be acquired and compared with the persistent entity to determine the changes. At any rate, it will take a bit more thought to design a reliable and elegant/maintainable solution. Simpler will be better initially and we can round this capability out more as we explore this feature more |
Jens Rantil opened DATACASS-187 and commented
Currently Spring Data Cassandra allows creation and recreation of keyspaces on startup (SchemaAction). Spring Data JPA also supports this but on a column level. That is, on startup is issues
on startup.
I'm not sure they support removal of columns, and I leave that up to the implementer whether to implement in this ticket or not
Issue Links:
The text was updated successfully, but these errors were encountered: