-
Notifications
You must be signed in to change notification settings - Fork 6
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
[FEATURE]: Use native Eloquent migration #28
Comments
Maybe this would be a code inspiration on how it can be done in WordPress:
|
Hi @rafaucau Thanks for sharing the links, the goal of I already started working on the subject by checking that the This new migration system is probably the last topic before releasing the v4 :) |
For information, I updated the ticket with the desired features. If you have ideas, do not hesitate to suggest :) |
I could create a Pull Request for this when I find some time. Here's my vision for it:
And this is what the setup method could look like: Dbout\WpOrm\Orm::setup([
'migrations' => [
'directory' => WP_ORM_MIGRATIONS_DIR,
'table' => apply_filters('my-plugin/migrations-table', 'my_plugin_migrations'),
],
'commands' => [
'enabled' => true,
'prefix' => 'orm',
],
'facades' => [
'enabled' => true
]
]); This approach would enable the use of WordPress filters and custom constants, allowing the library to be used across different independent plugins without conflicts. Plugins could define their own constants and filters. Note: When multiple independent plugins use this library, they should use tools like Strauss to prefix namespaces and other things to avoid version conflicts. What do you think about this approach? |
Hi @rafaucau Thanks for the proposal, I have a little less time than expected to work on this feature, thank you for your help:) I think the approach is good, just a little remark for the facades. In my own projects I use the Laravel facade system with a custom container, so it should be possible to pass its own container when initializing the DB facade. Dbout\WpOrm\Orm::setup([
...,
'facades' => [
'container' => new MyContainer(),
'enabled' => true
]
]); |
Replace
robmorgan/phinx
by custom migration tool. The migration system should ideally take over the same logic and functionality as what is proposed by Laravel.In order to make the system configurable, it is necessary to provide :
The text was updated successfully, but these errors were encountered: