gatekeeper icon indicating copy to clipboard operation
gatekeeper copied to clipboard

Define a table "prefix"

Open enygma opened this issue 9 years ago • 2 comments

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 avatar May 08 '15 10:05 enygma

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 avatar May 10 '15 13:05 enygma

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

enygma avatar Jul 02 '15 22:07 enygma