Atualizando backend de usuários para conter informações de contato

This commit is contained in:
Matheus Albino Brunhara
2022-06-19 22:20:30 -05:00
parent 0d2b7a6884
commit 01a30b0f17
11 changed files with 133 additions and 56 deletions

View File

@@ -1,7 +1,6 @@
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreateUsers1617210132141 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({

View File

@@ -0,0 +1,24 @@
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
export class AddCpfAndCnpjFieldToUsers1654814986232
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.addColumns('users', [
new TableColumn({
name: 'cpf',
type: 'varchar',
isNullable: true,
}),
new TableColumn({
name: 'cnpj',
type: 'varchar',
isNullable: true,
}),
]);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropColumns('users', ['cnpj', 'cpf']);
}
}