-
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
Keep yessql.db as the fallback name for sqlite #15157
Conversation
@hishamco note here I am using |
I will leave that one for @sebastienros to decide 😄 |
Usually, I see the recording and then react to feedback suggestions, but you didn't mention that's the meeting suggestion feel free to close my PR |
The meeting suggestion to lower case the name. This PR provides the fix I described in the issue. |
There are a lot of changes in your PR that might not be necessary, I agree with @Skrypt that we might need some sort of logging or validation Again while the IO check happened once I don't think it's a big issue |
@hishamco can you give me an example of an unnesasry change? This PR make renaming the file seemless without any breaking change. "Breaking change that we brought to main already". I still don't think we should be doing the IO check if we don't have to. Validation should not be needed. We also don't validate if someone changes other appsettings like site name, or database prefix... if you have access to the appsettings and make direct changes, we should assume that you know what you are doing and not add validation for that. |
Those are all valid arguments but in the end what we want is to make things easier for ITs that don't know that these settings may have a typo. If the app fails silently then who's going to go and debug the issue? You every time or an IT guy that will more likely look at the app logs to find what the issue might be? Now, here we are introducing a new failing point and on @hishamco PR we are doing an I/O check ... it's all about compromise here. I'm not against each of these submitted PR's so stop wasting time and leave it for @sebastienros to decide 😉 |
To be simpler. Test it, Rename the appsetting databasename and see what the app logs or not. |
According to the documentation, this should fix the issue: {
"OrchardCore_Data_Sqlite": {
"DatabaseName": "yessql.db",
"UseConnectionPooling": false
}
} |
@Skrypt if the file is missing, yessql will throw exception. That is enough for someone to know they screwed up the appsettings. I still don't believe we should have a check. In the framework if we check for everything IT does, we'll just bog down the framework. Perhapse, we should just undo that PR that introduced the breaking change and keep the file called |
I'm not sure what's the wrong with the above settings while its documented? we could close both PRs :) |
@hishamco the problem is that it is a breaking change that could be avoided. |
You can if you set the settings as I mentioned in #15157 (comment) |
I just tried it and I get nothing in the logs. I just get a 404 page when debugging the website with VS Code. And I tried with this branch. I added "DatabaseName": "OrchardCore.db" in the appsettings.json file of my tenant and I renamed the database to OrchardCore2.db Here is my log:
Don't assume, test it. 😠 |
@Skrypt if you tested this PR, then it assumes that your file is yessql.db. If the file is called anything else then it should be in the settings file. In the settings file you can have and the file should be |
All my point is about making a typo on that DatabaseName since the beginning. I tested the use case and I'm reporting you the issue. You said it would log ;it doesn't and it creates a new database named as what I'm adding in the appsettings.json file of my tenant instead of just throwing at the right place before creating a new database that will try to initialize a new setup. The worst part is that it doesn't even get me to the setup page. I get a 404 ... that's not good ... we can do better. Don't want to argue more on this. |
/// </summary> | ||
public string DatabaseName { get; set; } = "OrchardCore.db"; | ||
public string DatabaseName { get; private set; } |
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.
get; set;
Please revert the PR that changed the database name. We'll put it back when the migration path is well-defined and the implementation is not brittle. |
@hishamco @Skrypt
Fix #15154