-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
adding a new int column causes the name of the column to be populated in existing rows #157
Comments
Also happens in a STRING column |
nope, it cant be truth. I add columns almost every day and never faced such a problem. What database are you using? Maybe something wrong with how it shows the view of the table? Also since |
I know it doesn't make much sense, but it happens I promise! :-) actually, I think I forgot to mention something that might be crucial - I'm using sqlite provider. (sqlite might not be actually checking the validity of the data). If you want me to turn on some verbose sql logging to send you lemme know what you need me to do. |
I'll check this issue with sqlite. Can you enable your logging and send me queries ORM is executed for you? createConnection({
/// ...
logging: {
logQueries: true
}
}); |
Sure, here it is:
second run: (with the new column)
I believe I see the problem here, since the query refers the new column in the old table "tmdbId" as a quoted string, sqlite probaby just uses the actual string value when migrating the data instead of the column's value, as this column doesn't exist. |
Perhaps this could help? https://www.sqlite.org/lang_keywords.html If a keyword in single quotes (ex: 'key' or 'glob') is used in a context where an identifier is allowed but where a string literal is not allowed, then the token is understood to be an identifier instead of a string literal. If a keyword in double quotes (ex: "key" or "glob") is used in a context where it cannot be resolved to an identifier but where a string literal is allowed, then the token is understood to be a string literal instead of an identifier. |
fixed and released in |
Tested, works, thanks! |
I've added a new column to an existing table, and all existing rows were had the string name of the new column name in the new column value.
Steps to reproduce:
Start with this class, run and create db:
Insert some rows, modify the code to include another column
The text was updated successfully, but these errors were encountered: