-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[x] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[ ] latest
[ ] @next
[x] 0.2.7 (or put your version here)
Steps to reproduce or a small repository showing the problem:
MySQL version: 5.7
Typescript version: 3.0.1
Everytime schema:sync is called, typeorm drops all fk and re-create them. It also performs alter table change column to timestamp columns. The problem is when findChangedColumns is called.
Line
console.log("width:", tableColumn.width, columnMetadata.width);
console.log("precision:", tableColumn.precision, columnMetadata.precision);output:
for fk:
width: 10 undefinedfor timestamp:
precision: 0 nullExample entity:
@Entity('assignments')
export class Assignment {
@PrimaryGeneratedColumn({unsigned: true})
id: number;
@CreateDateColumn({precision: null, type: 'timestamp', default: () => 'CURRENT_TIMESTAMP'})
from: Date;
@Column({precision: null, type: 'timestamp', default: () => null, nullable: true})
to: Date;Reactions are currently unavailable