Adicionando rotas e lógica para Vans e Locadores de Vans

This commit is contained in:
Matheus Albino Brunhara
2022-06-19 22:21:12 -05:00
parent 01a30b0f17
commit 98fb081648
11 changed files with 495 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
import { MigrationInterface, QueryRunner, Table } from 'typeorm';
export class CreateVansTable1655691282002 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: 'vans',
columns: [
{
name: 'id_van',
type: 'uuid',
isPrimary: true,
generationStrategy: 'uuid',
default: 'uuid_generate_v4()',
},
{
name: 'plate',
type: 'varchar',
},
{
name: 'brand',
type: 'varchar',
},
{
name: 'model',
type: 'varchar',
},
{
name: 'seats_number',
type: 'numeric',
},
{
name: 'created_at',
type: 'timestamp',
default: 'now()',
},
{
name: 'updated_at',
type: 'timestamp',
default: 'now()',
},
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable('vans');
}
}