-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: Allow adding another database group #34
Conversation
daycry
commented
Aug 31, 2022
- Allow adding another database group
- Allow adding another database group
Thank you for sending a PR. We have updated the guideline for git commit. |
You must GPG-sign your work, certifying that you either wrote the work or otherwise have the right to pass it on to an open-source project. See Developer's Certificate of Origin. |
I tried it, but always return an error message. |
The basic steps: What did you do? |
Done. Key imported |
Who Can review this changes? I think that are interesting changes. |
src/Database/Migrations/2021-07-04-041948_CreateSettingsTable.php
Outdated
Show resolved
Hide resolved
It seems there is not test code. We need it. |
@daycry the development kit here does need to be updated but that should happen in a separate PR. I will try to get that done today, but please remove those changes from this PR in the meantime. I will wait to review, but generally this looks like a desirable feature! |
@daycry We have updated the development kit. Please rebase to resolve conflicts and remove unneeded changes in this PR. |
Ok, I Will do It. Although I have seen that the changes you have made in composer and phpunit are the same as I have done, I will delete my changes and create the pull request again. thank you! |
I do the signed commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Some design thoughts. Also please do try some tests - there should be some there that make a decent starting point.
use CodeIgniter\Settings\Handlers\ArrayHandler; | ||
use CodeIgniter\Settings\Handlers\DatabaseHandler; | ||
|
||
class Settings | ||
class Settings extends BaseConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there were recursion issues or something why Lonnie didn't originally make this an actual Config class. @lonnieezell you available to comment?
src/Database/Migrations/2021-07-04-041948_CreateSettingsTable.php
Outdated
Show resolved
Hide resolved
@@ -2,10 +2,22 @@ | |||
|
|||
namespace CodeIgniter\Settings\Database\Migrations; | |||
|
|||
use CodeIgniter\Config\BaseConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is okay to require the Config to be ours (or an extension thereof):
use CodeIgniter\Config\BaseConfig; | |
use CodeIgniter\Settings\Config\Settings; |
@@ -2,10 +2,22 @@ | |||
|
|||
namespace CodeIgniter\Settings\Database\Migrations; | |||
|
|||
use CodeIgniter\Config\BaseConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use CodeIgniter\Config\BaseConfig; | |
use CodeIgniter\Settings\Config\Settings; |
use CodeIgniter\Database\Migration; | ||
|
||
class CreateSettingsTable extends Migration | ||
{ | ||
private BaseConfig $config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private BaseConfig $config; | |
private Settings $config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, see below: this can be dropped altogether.
use CodeIgniter\Database\Migration; | ||
|
||
class AddContextColumn extends Migration | ||
{ | ||
private BaseConfig $config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private BaseConfig $config; | |
private Settings $config; |
Ok, I Will review your suggestions, and I Will do some tests integrating
the group attribute.
Thank you.
…On Fri, 2 Sept 2022, 11:52 MGatner, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/Database/Migrations/2021-07-04-041948_CreateSettingsTable.php
<#34 (comment)>:
> use CodeIgniter\Database\Migration;
class CreateSettingsTable extends Migration
{
+ private BaseConfig $config;
Never mind, see below: this can be dropped altogether.
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZ5DP6Z33D6JCDHVH67BY3V4HE7RANCNFSM6AAAAAAQBG7AA4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This may break backwards compatibility as if it doesn't check if it exists it will return error, because group doesn't currently exist. Co-authored-by: MGatner <mgatner@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error handling is probably a case for going with BaseConnection
instead of BaseBuilder
, but since these are "things really went wrong" situations it is more of a debug so I'm okay with it. Let's see what @kenjis thinks.
@MGatner What do you mean with the error handling? |
This PR looks good. I'm merging for now. |
@kenjis I meant the way the So yes: this is good, thanks for merging! |
(In the future though we should probably be squashing PRs like this that have "train of thought" commits.) |
I tried it, but always return an error message.
El mié, 31 ago 2022 a las 12:25, kenjis ***@***.***>)
escribió:
… You must GPG-sign
<https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/signing.md>
your work, certifying that you either wrote the work or otherwise have the
right to pass it on to an open-source project. See Developer's
Certificate of Origin
<https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/DCO.md>
.
See
https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#signing
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZ5DP3ODPAHNOMH54ZAV73V34XH7ANCNFSM6AAAAAAQBG7AA4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|