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

Save databases #87

Open
tannn opened this issue Nov 12, 2013 · 8 comments
Open

Save databases #87

tannn opened this issue Nov 12, 2013 · 8 comments

Comments

@tannn
Copy link
Owner

tannn commented Nov 12, 2013

One of the problems right now, while expected during testing, is that when changes are made to the database(s), it has to be dropped. While this is understandable, there should be a way for the plugin to allow exporting of the database so everything can be saved.

Possible Solutions

  1. Exporting the database - export the user and question databases. After the upgrade is complete, questions can be added again while the user database will need to be imported. Is it possible to do this through the command line?
  2. The plugin automatically identifies the database is outed/not compatible, then make the appropriate changes to make it compatible with the new version.
@ghost ghost assigned rootcoma Nov 12, 2013
@thomassross
Copy link
Contributor

OK, I will work on this ASAP. I think we will go with option 2

@rootcoma
Copy link
Collaborator

It is possible to update the tables without dropping them, what you are thinking of is called ALTER.

I can include the command line commands to ALTER the tables instead of needing to drop them if that is a priority.

Important note that this is easier to do for adding completely new columns than removing or changing columns names.

These 3 lines would have worked for the last update to the triviagames table

ALTER TABLE triviagames ADD COLUMN longest_streak integer;
ALTER TABLE triviagames ADD COLUMN longest_streak_holder text;
ALTER TABLE triviagames ADD COLUMN longest_streak_holder_canonical text;

Also you don't have to drop every table every time, last update only required triviagames to be dropped, which didn't hold scores or anything like that.

@thomassross
Copy link
Contributor

yes, rootcoma, that's what I'm thinking of doing, all we need to do now is to have an update to fix. I think i'll leave a blank space for the updates and then PR that. Then the next time we update we add those lines.

@tannn
Copy link
Owner Author

tannn commented Nov 21, 2013

I know TR worked on this a bit but is it finished or is more progress still needed?

@thomassross
Copy link
Contributor

@tannn as soon as we have a db to update then it shall work!

@tannn
Copy link
Owner Author

tannn commented Nov 22, 2013

@Th0masR0ss There's currently a database in SupyMonkey - so it's working now?

@thomassross
Copy link
Contributor

@tannn no I meant when the database needs to be updated we will add code to update it automatically. This issue can be closed if you want.

@tannn
Copy link
Owner Author

tannn commented Nov 23, 2013

@Th0masR0ss so the code won't be always present, in the event am update is made from an older version of the plugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants