Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Currently, all the migration scripts for all the services/repos (sunbird-lms-service, group-service, sunbird-notification-service, and sunbird-course-service) are packaged with the cassandra-migration module jar. And all the migration information is stored in the cassandra_migration_version table and cassandra_migration_version_counts tables in the sunbird keyspace (used for sunbird-lms-service).

...

  1. Separate the migration script based on respective services/repos.

  2. Remove the bundling on script as a part of cassandra-migration module and variabilise the script path.

  3. Variabilize the keyspace for cassandra-migration module.

  4. Maintain the release version that in which release version that script introduced.

Design

Each keyspace will have it’s own cassandra_migration_version and cassandra_migration_version_counts table.

  • Add the release version in the filename.

    Code Block
    V1.<migration_version>_cassandra-<release_version>.cql
    
    e.g.
    V1.1_cassandra-release-5.2.0.cql
    
    

    Sample of cassandra_migration_version and cassandra_migration_version_counts table:

Code Block
breakoutModewide
cqlsh> SELECT * FROM sunbird_groups.cassandra_migration_version;

 version | checksum    | description             | execution_time | installed_by | installed_on                    | installed_rank | script                           | success | type | version_rank
---------+-------------+-------------------------+----------------+--------------+---------------------------------+----------------+----------------------------------+---------+------+--------------
     1.1 | -1118871967 | cassandra-release-5.2.0 |              6 |    cassandra | 2023-02-06 05:04:39.893000+0000 |              1 | V1.1_cassandra-release-5.2.0.cql |    True |  CQL |            1

(1 rows)


cqlsh> SELECT * FROM sunbird_groups.cassandra_migration_version_counts;

 name           | count
----------------+-------
 installed_rank |     1

(1 rows)
  • Separate all the migration script based on repos and push it to that specific repo.

    Image Added
  • Image Added