-
-
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
TypeORM version:
[ ] latest
[ ] @next
[ X] 0.2.6 (or put your version here)
Steps to reproduce or a small repository showing the problem:
- Create new entity file:
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
@Entity('test')
export class Test {
@PrimaryGeneratedColumn()
id: number;
@Column({type: 'datetime', nullable: true, default: null})
publish_date: Date;
}
- Run command schema:sync
Initial run of command shows:
CREATE TABLE `test` (`id` int NOT NULL AUTO_INCREMENT, `publish_date` datetime NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB
- Confirm table has been created
- Run schema:sync again
Run will show an alter table erroneously (and will repeat on every run)
ALTER TABLE `test` CHANGE `publish_date` `publish_date` datetime NULL
Reactions are currently unavailable