This commit is contained in:
Hugo Falcao
2022-06-18 14:11:43 -03:00
parent bf5620a5fc
commit 2ff921ee24
11 changed files with 362 additions and 1 deletions

View File

@@ -0,0 +1,51 @@
import {MigrationInterface, QueryRunner, Table} from "typeorm";
export class CreateUsersSearching1652672860580 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: 'users_searching',
columns: [
{
name: 'id_search',
type: 'integer',
isPrimary: true,
isGenerated: true,
generationStrategy: 'increment',
},
{
name: 'user_id',
type: 'uuid'
},
{
name: 'latitude_from',
type: 'numeric',
},
{
name: 'longitude_from',
type: 'numeric',
},
{
name: 'latitude_to',
type: 'numeric',
},
{
name: 'longitude_to',
type: 'numeric',
},
{
name: 'created_at',
type: 'timestamp',
default: 'now()',
}
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable('users_searching');
}
}