Remove tabela CarBrands e inclui rotas para recuperar marcas e modelos

This commit is contained in:
Matheus Albino Brunhara
2022-08-29 01:30:23 -03:00
parent b4998b7c3e
commit 22a1a3dbfa
6 changed files with 1156 additions and 1047 deletions

View File

@@ -0,0 +1,15 @@
import {MigrationInterface, QueryRunner} from "typeorm";
export class RenameCarModelsTableToCarBrands1661212542739 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.renameTable('carModels', 'carBrands')
await queryRunner.renameColumn('carBrands', 'id_model', 'id_brand')
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.renameTable('carBrands', 'carModels')
await queryRunner.renameColumn('carBrands', 'id_brand', 'id_model')
}
}