Created
September 17, 2021 12:40
-
-
Save alanfoandrade/6ca812b2a6e68831d77b2c1c5dcaf91b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; | |
export default class AlterDateToDateTime1631573747885 | |
implements MigrationInterface | |
{ | |
public async up(queryRunner: QueryRunner): Promise<void> { | |
await queryRunner.changeColumn( | |
'leads', | |
'createdAt', | |
new TableColumn({ | |
name: 'createdAt', | |
type: 'timestamp', | |
}), | |
); | |
await queryRunner.changeColumn( | |
'users', | |
'createdAt', | |
new TableColumn({ | |
name: 'users', | |
type: 'timestamp', | |
}), | |
); | |
await queryRunner.changeColumn( | |
'teams', | |
'createdAt', | |
new TableColumn({ | |
name: 'createdAt', | |
type: 'timestamp', | |
}), | |
); | |
await queryRunner.changeColumn( | |
'properties', | |
'createdAt', | |
new TableColumn({ | |
name: 'createdAt', | |
type: 'timestamp', | |
}), | |
); | |
} | |
public async down(queryRunner: QueryRunner): Promise<void> { | |
await queryRunner.changeColumn( | |
'properties', | |
'createdAt', | |
new TableColumn({ | |
name: 'createdAt', | |
type: 'timestamp with time zone', | |
}), | |
); | |
await queryRunner.changeColumn( | |
'teams', | |
'createdAt', | |
new TableColumn({ | |
name: 'createdAt', | |
type: 'timestamp with time zone' | |
}), | |
); | |
await queryRunner.changeColumn( | |
'users', | |
'createdAt', | |
new TableColumn({ | |
name: 'createdAt', | |
type: 'timestamp with time zone' | |
}), | |
); | |
await queryRunner.changeColumn( | |
'leads', | |
'createdAt', | |
new TableColumn({ | |
name: 'createdAt', | |
type: 'timestamp with time zone' | |
}), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment