-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add database options like TablePrefixSeparator, Schema, IdentityColumnType, and DocumentTable #12683
Add database options like TablePrefixSeparator, Schema, IdentityColumnType, and DocumentTable #12683
Conversation
…ma and the identity column type
Can we merge #12363 before? One more thing I think we discussed before that the above changes could after I might review this after I finish some of my pending PRs ;) |
This is getting late for 1.5 |
FYI @MikeAlhayek I'm not pushing to merge my PR ;) it's jsut refactoring notRhing else, but this PR has introduce new things that might have consequences. I'm totally agree with @Skrypt that this PR is too late, I appreciate your efforts but we are in a stable state to release |
@MikeAlhayek Okay, looks now much better ;) |
@jtkech glad you like the change :) If you see no further changes, please approve the PR. Thought on merging this in 1.5 to avoid having to deal with an obsolete YesSqlOptions later? |
I will try it this night |
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.
As a last comment, so we can select some new options while creating/editing a tenant, then not on the setup form. So how can we define them for the Default tenant on a fresh setup, if not intended that's okay knowing that it is still possible from the regular Configuration.
Yes, some issues quite easy to fix, the main concern being that we can't persist through Shell Settings an empty string, but I prefer this approach even if there are remaining things to fix.
Otherwise LGTM.
src/OrchardCore.Modules/OrchardCore.AutoSetup/AutoSetupMiddleware.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.AutoSetup/AutoSetupMiddleware.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.AutoSetup/Options/TenantSetupOptions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.AutoSetup/Options/TenantSetupOptions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.YesSql.Abstractions/DatabaseTableOptions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.YesSql/DbConnectionValidator.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.YesSql/OrchardCoreBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.YesSql/OrchardCoreBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
@jtkech I made all the changes including adding the same value to the API and to the workflow activities. UPDATED I also added the database properties to the Setup screen so even when the Default site is being setup, we can provide/change the options |
Okay cool, I will look at it asap. |
src/OrchardCore/OrchardCore.Abstractions/Setup/SetupConstants.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.YesSql.Abstractions/DefaultTableNameConvention.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.YesSql.Abstractions/DefaultTableNameConvention.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.YesSql/DbConnectionValidator.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.ContentManagement.GraphQL/Queries/Predicates/PredicateQuery.cs
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.YesSql/OrchardCoreBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.AutoSetup/Options/TenantSetupOptions.cs
Outdated
Show resolved
Hide resolved
Only did a quick review but LGTM. Yes for now the But in other places we may need to respect the existing usage of APIs, already defined WFs and existing AutoSetup configs, meaning if nothing is changed the Yes, this is the only remaining thing I still have to think about. |
Co-authored-by: Jean-Thierry Kéchichian <[email protected]>
@jtkech I made the last suggested changes. Let me know if you see any last items here. Please check the update I made to the workflow and the api controller to make sure I did what you suggested. |
src/OrchardCore.Modules/OrchardCore.AutoSetup/AutoSetupMiddleware.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.AutoSetup/AutoSetupMiddleware.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Setup/Controllers/SetupController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Setup/Controllers/SetupController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Abstractions/Setup/SetupConstants.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Setup/Views/Setup/Index.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
I did a review, sorry if too long but one thing imply two others (exponential), maybe some parts could be managed in separate PR(s). One main point would be to manage new database fields like the existing ones as much as possible, which would be easier if we don't support empty separators, or if all binding sources (behaving dfferently) should provide the same dedicated value for this purpose. |
…are.cs Co-authored-by: Jean-Thierry Kéchichian <[email protected]>
Okay, just saw the last meeting, looks like what I did is in sync with what was suggested. |
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 tested out all the new changes you added to this PR. All looks good to me and it also falls inline with all the feedback we had during the meeting. I have some minor suggestions here.
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
Okay done but wait, maybe some very last little simplifications |
@jtkech thanks. We'll check it tomorrow and ensure there is no more feedback from @sebastienros tomorrow before we merge it. |
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.
May be I'm late to review this, but I suffered last two weeks from a damaged hard disk in my previous laptops. I just write down some comments that might be consider
src/OrchardCore.Modules/OrchardCore.AutoSetup/AutoSetupMiddleware.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.AutoSetup/Options/TenantSetupOptions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Setup/Controllers/SetupController.cs
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/Controllers/ApiController.cs
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Tenants/ViewModels/SetupApiViewModel.cs
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,49 @@ | |||
@model EditTenantViewModel |
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 why the partials relying on EditTenantViewModel
, it would be nice to use the UI components in both Create & Edit views
src/OrchardCore.Modules/OrchardCore.Tenants/Workflows/Activities/CreateTenantTask.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Data.Abstractions/ShellSettingsExtensions.cs
Show resolved
Hide resolved
…tupOptions.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…ensions.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…iViewModel.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…ontroller.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…troller.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…ontroller.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
…ontroller.cs Co-authored-by: Hisham Bin Ateya <[email protected]>
Please wait before merging, need to check the last review / commits, at least fix unit tests. |
@jtkech no worries. Either approve or merge it when you are done making changes to it. Thank you |
I already approved it a while ago ;) I'm merging it |
This PR addresses the concerns #12657
Here is a summary of the changes
Both
TableNameConvention
andTablePrefixSeparator
were removed fromYesSqlOptions
.The following properties were added to the
ShellSettings
of each tenantTablePrefixSeparator
when this value does not exists we assume_
however, if empty string is found, we use no prefix for the tables.Schema
this was added to allow you to provide a specific schema to use.IdentityColumnSize
when this value is empty or invalid, we assumeInt32
DocumentTable
when this value is empty we assume "Document"If adding a new tenant failed due to missing
Encrypt=false
orTrustServerCertificate=True
, we add the error to the log file to provide the admin more about the issue. Address issue #12679 and #12653.@jtkech in the remove tenant code, you can use the new
ITableNameConventionFactory
to create an instance ofITableNameConvention
with something like thisITableNameConventionFactory
is a service that we register so you can inject it inShellDbTablesInfo
to create the tableNameConvention.Added the following fields were added to Add/Edit tenant in the tenant UI and also to the setup screen when the database isn't configured.