-
Notifications
You must be signed in to change notification settings - Fork 17
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
[RFC] migration from members to auth #4
Comments
Looks like both sqlite and postgresql support RENAME TO:
https://sqlite.org/lang_altertable.html
https://www.postgresql.org/docs/9.1/static/sql-altertable.html
It'd be nice to have a check/automatic fix, sure, but I also don't want
anyone to think that it's a drop in replacement since you will also need to
move the config and edit your templates to make it work.
…On Thu, Jun 8, 2017 at 4:09 PM, Lodewijk Evers ***@***.***> wrote:
If you have a website that had the Members extension and you want to
replace that extension with the Auth extension you will need to update the
database to make everything happen smoothly.
On mysql you can probably perform the following queries in your bolt
database:
ALTER TABLE `bolt_members_account` RENAME TO `bolt_auth_account` ;ALTER TABLE `bolt_members_account_meta` RENAME TO `bolt_auth_account_meta` ;ALTER TABLE `bolt_members_oauth` RENAME TO `bolt_auth_oauth` ;ALTER TABLE `bolt_members_provider` RENAME TO `bolt_auth_provider` ;ALTER TABLE `bolt_members_token` RENAME TO `bolt_auth_token` ;
But not all servers might support RENAME TO
And after that the schema needs to be updated too.
Is it possible to make this happen automagically?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE3EuHV2rCJCeV0Tf0rFeQaqVZBZgxceks5sCACSgaJpZM4N0IFW>
.
|
Hmm.. I'm finding out about the not a drop in replacement at the moment too ... Maybe a list of common things that need to change somewhere. Stuff like |
The procedure is basically: "Is it called member? change it to auth." I thought it best to be consistent with the renaming, so I renamed all the things. |
@jadwigo I've been thinking about this one. There is no way for us to automatically fix all of these things, and even if we could fix db tables, config and templates via some god-awful regex or some other method that'd still leave any extensions that depend on the old namespaces and so on. I'd rather view this as a "spiritual continuation" sort of thing, not a drop-in replacement, and half-assing the migration (only updating the db tables) does not seem productive to me. I'd be very happy to have that SQL in the docs though, it just seems to me like automating it is setting up expectations we won't meet. Does that make sense to you? |
Yes it makes sense... automating it would probably mean also creating a transpiler for members-addon extensions or something like that. Maybe a "migrating_from_members.md" in the documentation that outlines the steps you need to do would do the trick. |
Yep, gonna put that together before I tag :) I'mma keep this issue around to remind me to do it |
For PostgreSQL you need: ALTER TABLE bolt_members_account RENAME TO bolt_auth_account;
ALTER TABLE bolt_members_account_meta RENAME TO bolt_auth_account_meta;
ALTER TABLE bolt_members_oauth RENAME TO bolt_auth_oauth;
ALTER TABLE bolt_members_provider RENAME TO bolt_auth_provider;
ALTER TABLE bolt_members_token RENAME TO bolt_auth_token;
ALTER SEQUENCE bolt_members_account_id_seq RENAME TO bolt_auth_account_id_seq;
ALTER SEQUENCE bolt_members_account_meta_id_seq RENAME TO bolt_auth_account_meta_id_seq;
ALTER SEQUENCE bolt_members_oauth_id_seq RENAME TO bolt_auth_oauth_id_seq;
ALTER SEQUENCE bolt_members_provider_id_seq RENAME TO bolt_auth_provider_id_seq;
ALTER SEQUENCE bolt_members_token_id_seq RENAME TO bolt_auth_token_id_seq; |
I've added a page in the docs for this, if there is anything else that you feel should go there please an issue or PR in the docs repo! :) |
If you have a website that had the Members extension and you want to replace that extension with the Auth extension you will need to update the database to make everything happen smoothly.
On mysql you can probably perform the following queries in your bolt database:
But not all servers might support
RENAME TO
And after that the schema needs to be updated too.
Is it possible to make this happen automagically?
The text was updated successfully, but these errors were encountered: