1
I am trying to create a table in the Mysql database, with Typeorm where the id is ambiente_id
(nome da tabela
+ _
+ id
).
Error:
ER_WRONG_AUTO_KEY: Incorrect table Definition; there can be only one auto column and it must be defined as a key code: 'ER_WRONG_AUTO_KEY', Rrno: 1075, sqlMessage: 'Incorrect table Definition; there can be only one auto column and it must be defined as a key', sqlState: '42000', index: 0, sql: 'ALTER TABLE
ambiente
ADDid
int NOT NULL AUTO_INCREMENT'
My entity:
@Entity()
export class Ambiente {
@PrimaryGeneratedColumn({name: 'ambiente_id'})
ambiente_id: number;
My database config is with synchronize: true
.
the error was that it was building on top of the /dist folder, not removing and rebuilding, only rebuilding on top of the folder already created there was error.
– Vitor Garselaz Dias