You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This resulted in the following SQL query and error:
ALTERTABLE`some_entity` CHANGE `created_at``createdAt` datetime(6) NOT NULL DEFAULT 'current_timestamp(6)'
QueryFailedError: ER_TRUNCATED_WRONG_VALUE: Incorrect datetime value: 'current_timestamp(6)' for column ``.``.`createdAt` at row 1
I think that TypeORM is reading the default value and using it when renaming the column, but not understanding that the current_timestamp(6) coming from the database is not a string but TypeORM is passing a string back to the database.
This happens no matter what form of renameColumn or changeColumn I use since renameColumn just defers to changeColumn and changeColumn decides whether to change or rename based on whether the TableColumn data you pass in is different.
The text was updated successfully, but these errors were encountered:
…ies during synchronization (#7517)
* fix#3991
* fix#3991
* improved test for #2737;
fixed remaining issues in #2737;
* fix#6412
* added test for #4281 and #4658
* fixed `NOW()` function usage in MySQL/MariaDB;
fixed precision in datetime functions for MySQL/MariaDB;
improved #3991 test for MySQL/MariaDB;
* added test for #2333
* added test for #7381
* added "remove" operation check in #4658 test
* fixed precision in datetime functions for PostgreSQl;
improved #3991 test for PostgreSQl;
* improved #3991 test for CockroachDB;
* improved #3991 test for Sqlite;
* improved #3991 test for Oracle and SQLServer;
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[x]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[ ]
latest
[ ]
@next
[x]
0.2.17
Steps to reproduce or a small repository showing the problem:
I was renaming a createdAt column created by
@CreateDateColumn()
fromcreated_at
tocreatedAt
using this migration.This resulted in the following SQL query and error:
I think that TypeORM is reading the default value and using it when renaming the column, but not understanding that the
current_timestamp(6)
coming from the database is not a string but TypeORM is passing a string back to the database.This happens no matter what form of renameColumn or changeColumn I use since renameColumn just defers to changeColumn and changeColumn decides whether to change or rename based on whether the TableColumn data you pass in is different.
The text was updated successfully, but these errors were encountered: