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

How to implement cards migration? #11

Open
PackRuble opened this issue Dec 18, 2023 · 1 comment
Open

How to implement cards migration? #11

PackRuble opened this issue Dec 18, 2023 · 1 comment
Labels
discussion There's a lot to discuss documentation Improvements or additions to documentation enhancement New feature or request

Comments

@PackRuble
Copy link
Owner

PackRuble commented Dec 18, 2023

There is a distant idea that card migration could be implemented.
Why?

  • was MyCard.index. We wanted to make MyCard.currentIndex. In the SP this lives with the index key, and the new desired key is currentIndex (let's say the naming matches the enumeration - it doesn't matter now). I'd like to add a deprecated annotation to the old card and create a new card + specify "something" for migration.
  • previously we used the shared_preferences package. Now we would like to use Cardoteka and move all the old keys to the new addresses (re-saving the values of course)

I think it should be in CardotekaConfig as a field and passed as a parameter. Implementation can be done as a getter when defining MyCard's (or wherever). I would like to use a separate class, but in Map form I see it like this (pseudo code):

enum MyCard implements Card {
  ...values

  static get migrator => {
    'old_key': MyCard.newKey,
  };
}

There's an important point here: we want to transfer values to another key in SP (and delete the old key).

@PackRuble PackRuble added enhancement New feature or request discussion There's a lot to discuss labels Dec 18, 2023
@PackRuble PackRuble added the documentation Improvements or additions to documentation label Oct 2, 2024
@PackRuble
Copy link
Owner Author

Also, add a section to the readme about card migrations (and key migrations with shared_preferenses)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion There's a lot to discuss documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant