In CassandraDataAutoConfiguration, this property is hard-coded to SchemaAction.NONE.
Please add this property to CassandraProperties so it can be easily changed.
CassandraSessionFactoryBean requires an initial set of entities to perform schema actions. Spring Data Cassandra has _some_ support for it but it's an ugly solution. The initialEntitySet of BasicCassandraMappingContext is not set so SchemaAction would not create any tables at all. The initialization of BasicCassandraMappingContext would require an entity scan similar to MongoDataAutoConfiguration.
Flipping the option is only one part but the application has to provide also a @Bean for BasicCassandraMappingContext. Otherwise, setting SchemaAction has a very limited effect - the tables get removed with SchemaAction.RECREATE and SchemaAction.RECREATE_DROP_UNUSED but not (re) created.
Closing in favour of the PR #5855
Most helpful comment
CassandraSessionFactoryBeanrequires an initial set of entities to perform schema actions. Spring Data Cassandra has _some_ support for it but it's an ugly solution. TheinitialEntitySetof BasicCassandraMappingContext is not set soSchemaActionwould not create any tables at all. The initialization ofBasicCassandraMappingContextwould require an entity scan similar to MongoDataAutoConfiguration.Flipping the option is only one part but the application has to provide also a
@BeanforBasicCassandraMappingContext. Otherwise, settingSchemaActionhas a very limited effect - the tables get removed withSchemaAction.RECREATEandSchemaAction.RECREATE_DROP_UNUSEDbut not (re) created.