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

Define a table "prefix" #6

Open
enygma opened this issue May 8, 2015 · 2 comments
Open

Define a table "prefix" #6

enygma opened this issue May 8, 2015 · 2 comments

Comments

@enygma
Copy link
Member

enygma commented May 8, 2015

Currently the Gatekeeper tables are relatively commonly named (users, groups, etc) and those could conflict with a system's current tables. A prefix option should be added to the .env handling allowing the prefix to be included on the tables. If no prefix is defined, it will revert to the current default table names.

Consider possibly adding the ability to migrate the data structure too, adding a method that would check for a prefix and, if found and not currently in use, use a SELECT INTO or something similar to migrate each of the tables. A special set of Phinx migrations could be included for this too.

@enygma
Copy link
Member Author

enygma commented May 10, 2015

The migrations themselves have been updated to work with the DB_PREFIX setting via a parent class. Additionally, the base Mysql model and collection now respect the prefix for getting class names. The only thing left is changing the manual queries...

Oh, and the Phinx project has a PR I submitted to support bootstraping. In my testing I'm using this to set the needed superglobal value but I might have to find another way as it doesn't look like it'll be accepted anytime soon.

@enygma
Copy link
Member Author

enygma commented Jul 2, 2015

Apparently you can also use a .php file as a configuration for Phinx...might need to go that way with it.

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

1 participant