From 475c082ec565fc031189c9da40a61057618f76f8 Mon Sep 17 00:00:00 2001 From: Josimar16 Date: Fri, 6 Aug 2021 20:58:56 -0300 Subject: [PATCH 1/2] feat: :sparkles: creating migration to user entity creating the migration with the necessary fields to be able to login --- .../migrations/1628121901758-CreateUser.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 backend/src/shared/infra/typeorm/migrations/1628121901758-CreateUser.ts diff --git a/backend/src/shared/infra/typeorm/migrations/1628121901758-CreateUser.ts b/backend/src/shared/infra/typeorm/migrations/1628121901758-CreateUser.ts new file mode 100644 index 0000000..1571cc3 --- /dev/null +++ b/backend/src/shared/infra/typeorm/migrations/1628121901758-CreateUser.ts @@ -0,0 +1,42 @@ +import { MigrationInterface, QueryRunner, Table } from "typeorm"; + +export default class CreateUser1628121901758 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.createTable( + new Table({ + name: "users", + columns: [ + { + name: "id", + type: "uuid", + isPrimary: true + }, + { + name: "name", + type: "varchar" + }, + { + name: "password", + type: "varchar" + }, + { + name: "email", + type: "varchar", + isUnique: true + }, + { + name: "created_at", + type: "timestamp", + default: "now()" + } + ] + }) + ) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropTable("users"); + } + +} From 0febb888da544d282d712bcddfcb8de1cd706b11 Mon Sep 17 00:00:00 2001 From: Josimar16 Date: Fri, 6 Aug 2021 21:00:44 -0300 Subject: [PATCH 2/2] feat: :sparkles: creating migration to property entity creating the migration with the necessary fields to be able to make the crud property --- .../1628122047487-CreateProperty.ts | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 backend/src/shared/infra/typeorm/migrations/1628122047487-CreateProperty.ts diff --git a/backend/src/shared/infra/typeorm/migrations/1628122047487-CreateProperty.ts b/backend/src/shared/infra/typeorm/migrations/1628122047487-CreateProperty.ts new file mode 100644 index 0000000..68743d3 --- /dev/null +++ b/backend/src/shared/infra/typeorm/migrations/1628122047487-CreateProperty.ts @@ -0,0 +1,77 @@ +import {MigrationInterface, QueryRunner, Table} from "typeorm"; + +export default class CreateProperty1628122047487 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.createTable( + new Table({ + name: "properties", + columns: [ + { + name: "id", + type: "uuid", + isPrimary: true + }, + { + name: "title", + type: "varchar" + }, + { + name: "description", + type: "varchar" + }, + { + name: "value", + type: "integer" + }, + { + name: "area", + type: "integer" + }, + { + name: "address", + type: "varchar" + }, + { + name: "public_place", + type: "varchar" + }, + { + name: "house_number", + type: "integer" + }, + { + name: "complement", + type: "varchar" + }, + { + name: "district", + type: "varchar" + }, + { + name: "cep", + type: "integer" + }, + { + name: "city", + type: "varchar" + }, + { + name: "uf", + type: "varchar" + }, + { + name: "created_at", + type: "timestamp", + default: "now()" + } + ] + }) + ) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropTable("properties"); + } + +}