patka / cassandra-migration

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

CassandraMigrationAutoConfiguration.MIGRATION_TASK_BEAN_NAME not published #76

Closed tom-cordiance closed 1 year ago

tom-cordiance commented 1 year ago

The constant MIGRATION_TASK_BEAN_NAME appears to not be published in 2.5.0_v4.

Here is what I see with the 2.5.0_v4 dependency:

@Configuration
@EnableConfigurationProperties(CassandraMigrationConfigurationProperties.class)
@AutoConfigureAfter(CassandraAutoConfiguration.class)
@ConditionalOnClass(CqlSession.class)
public class CassandraMigrationAutoConfiguration {
    public static final String CQL_SESSION_BEAN_NAME = "cassandraMigrationCqlSession";
    private final CassandraMigrationConfigurationProperties properties;

    @Autowired
    public CassandraMigrationAutoConfiguration(CassandraMigrationConfigurationProperties properties) {
        this.properties = properties;
    }

    @Bean(initMethod = "migrate")
    @ConditionalOnBean(value = CqlSession.class)
    @ConditionalOnMissingBean(MigrationTask.class)
    public MigrationTask migrationTask(@Qualifier(CQL_SESSION_BEAN_NAME) CqlSession cqlSession) {

Here is what I see when I browse the GitHub code:

@Configuration
@EnableConfigurationProperties(CassandraMigrationConfigurationProperties.class)
@AutoConfigureAfter(CassandraAutoConfiguration.class)
@ConditionalOnClass(CqlSession.class)
public class CassandraMigrationAutoConfiguration {
    public static final String CQL_SESSION_BEAN_NAME = "cassandraMigrationCqlSession";
    public static final String MIGRATION_TASK_BEAN_NAME = "migrationTask";
    private final CassandraMigrationConfigurationProperties properties;

    @Autowired
    public CassandraMigrationAutoConfiguration(CassandraMigrationConfigurationProperties properties) {
        this.properties = properties;
    }

    @Bean(name = MIGRATION_TASK_BEAN_NAME, initMethod = "migrate")
    @ConditionalOnBean(value = CqlSession.class)
    @ConditionalOnMissingBean(MigrationTask.class)
    public MigrationTask migrationTask(@Qualifier(CQL_SESSION_BEAN_NAME) CqlSession cqlSession) {
patka commented 1 year ago

Yes, it is not. The reason is that the current code on Github is the current development snapshot and this constant was introduced after the last release. There is a new release in the making which should be available within the next 2 weeks and it will include this constant.

patka commented 1 year ago

New version 2.6.0_v4 is released and the property is available now. Give it some time to be distributed in the maven repos.