valchkou / cassandra-driver-mapping

JPA addon for DataStax Java Driver for Cassandra
58 stars 24 forks source link

PRIMARY key migration sync isn't working #82

Open kojiba opened 7 years ago

kojiba commented 7 years ago

If U change bean idea from Compound Primary Key to Composite Partition Key DDL will not be synced, i.e.

List<RegularStatement> statements = buildSyncStatements(keyspace, session, entityMetadata, syncOptions);

will return empty list, but entity metadata will be builded correct

valchkou commented 7 years ago

Thanks for the comment. Cassandra does not allow to alter the key after the table has been created. Btw. I am currently working on rebuilding the module using the latest driver. Can you add more details on what exactly you doing so I can estimate if this needs to be taken care of

kojiba commented 7 years ago

Can U add option to drop table and create a new one if key changed. Like:

@Table(forceUpdateTableIfKeyChanged= true)