1
Good evening, you guys. In this project I am using typeorm to configure my database. I create my Migration, but when I execute the command Yarn typeorm Migration:run, It doesn’t create the table I set. It creates in the database only the Migrations table, the other table 'Employee' it does not create.
https://github.com/SamuelB7/employee_manager2
Can someone help me?
export class employees1603488907171 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(new Table({
name: 'employee',
columns: [
{
name: 'id',
type: 'integer',
unsigned: true,
isPrimary: true,
isGenerated: true,
generationStrategy: 'increment',
},
{
name:'name',
type: 'text',
isNullable: false
}
]
}))
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable('employee')
}
}
Check that Migration is already in your Migrations table, run the down of that Migration and then run the up.
– Thiago Morais
I decided to switch to sequelize, for what I researched, typeorm is more typescript oriented, and in this project that I am developing, I want to use only javascript.
– Samuel Belo