-
Notifications
You must be signed in to change notification settings - Fork 77
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
remove(sh_sql): Remove adding columns to existing database table #1419
base: master
Are you sure you want to change the base?
Conversation
Before this change it was possible to add columns to an existing database table through the `sql.CreateSqlTable()` function. This is a troublesome and undocumented(!) functionality which should not exist going further. Troublesome as once a column is added there is no way back. This whole functionality also sways from the `CreateSqlTable` expectation as running a `CREATE TABLE` statement on an existing sqlite table fails normally. (In our case we used this function to ensure a table exists, hence we now return `true` if the table already exists) `sql.CreateSqlTable` is now also "soft" deprecated through our code annoations and therefore in our api-docs. Handling database table definitions should be done through migrations from now on. "Hard" deprecation (`ErrorNoHalt` on function call) should follow once we have migrated our codebase to use migrations to prevent spamming of deprecation messages. Additionally this partially fixes #1418 as one of the offending pragma statements is removed.
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.
Generally fine to deprecate it. But I dont like it, that there is no alternative besife writing sql code yourself. I'd like to keep the create sql table function and rather limit it to migrations.
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.
Was this functionality used somewhere in our codebase? It is really weird and unexpected behaviour. I therefore agree with your change here. Not sure if it should be Dev 1 or 2, but I think it is fine that way!
Everytime we changed the savingKeys for the shop for example, this was used. |
I'm a bit OOTL on all the recent database/migration changes. So was this changed already? or is this PR breaking things? |
Lets explain it like this: With this PR this will be forbidden or just not used anymore. |
Ok, I get it now, thank you! |
Given that this would break users that have played ttt2 before v0.12.0 but haven't started v0.12.0 or above yet i'm not exactly keen on merging this without having the affected tables be fully controlled by migrations. |
Migrations are done now, in case you want to finish this PR! |
Before this change it was possible to add columns to an existing database table through the
sql.CreateSqlTable()
function.This is a troublesome and undocumented(!) functionality which should not exist going further.
Troublesome as once a column is added there is no way back. This whole functionality also sways from the
CreateSqlTable
expectation as running aCREATE TABLE
statement on an existing sqlite table fails normally. (In our case we used this function to ensure a table exists, hence we now returntrue
if the table already exists)sql.CreateSqlTable
is now also "soft" deprecated through our code annoations and therefore in our api-docs.Handling database table definitions should be done through migrations from now on.
"Hard" deprecation (
ErrorNoHalt
on function call) should follow once we have migrated our codebase to use migrations to prevent spamming of deprecation messages.Additionally this partially fixes (screw you github...) #1418 as one of the offending pragma statements is removed.
A few notes:
Dev
messages, maybe those could be improved/changed