Skip to content
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

mmlid: Simple cassandra migration library #1646

Closed
dirkmc opened this issue Aug 24, 2023 · 0 comments
Closed

mmlid: Simple cassandra migration library #1646

dirkmc opened this issue Aug 24, 2023 · 0 comments
Assignees

Comments

@dirkmc
Copy link
Contributor

dirkmc commented Aug 24, 2023

As part of the solution to #1623 we will need to integrate a cassandra migration into boost.

We need to change the MinerAddr column from t1234 to f1234, however there are no built-in string manipulation functions, and yugabyte does not support user defined functions. So we need a migration library that can run golang migration functions.

We use goose to do this for sqlite and postgres, but it turns out that:

  • goose doesn't support cassandra
  • to add cassandra support is not straight-forward, because
  • goose uses the sql.DB construct

Given all of the above, I think we should write a simple migration library ourselves for cassandra that

  • uses hard-coded migration functions with a name and a migrate function
  • only does up migrations
  • does not have any CLI tools
  • creates a table migration_version with a name columns to keep track of cassandra migrations
  • when boost starts up it
    • checks migration_version against the array of migration functions
    • if there are any migration functions that have not been run it
      • runs the function
      • adds a row for each one to the migration_version table
@dirkmc dirkmc changed the title Simple cassandra migration library mmlid: Simple cassandra migration library Aug 24, 2023
@jacobheun jacobheun added this to Boost Aug 24, 2023
@dirkmc dirkmc self-assigned this Aug 24, 2023
@dirkmc dirkmc moved this to In Progress in Boost Aug 24, 2023
@dirkmc dirkmc mentioned this issue Aug 25, 2023
1 task
@dirkmc dirkmc closed this as completed Aug 29, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Boost Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant