From 042e3b9862b253fb3c3e59ee628dd9e30edf7e35 Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Tue, 29 Mar 2022 20:17:08 -0600 Subject: Chatrooms created --- .../migrations/1648605030863-AddChatRoom.ts | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 server/database/migrations/1648605030863-AddChatRoom.ts (limited to 'server/database') diff --git a/server/database/migrations/1648605030863-AddChatRoom.ts b/server/database/migrations/1648605030863-AddChatRoom.ts new file mode 100644 index 0000000..d8eed52 --- /dev/null +++ b/server/database/migrations/1648605030863-AddChatRoom.ts @@ -0,0 +1,43 @@ +import { MigrationInterface, QueryRunner, Table } from 'typeorm'; + +export class AddChatRoom1648605030863 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.createTable( + new Table({ + name: 'chatroom', + columns: [ + { + name: 'id', + type: 'int', + isPrimary: true, + isGenerated: true, + }, + { + name: 'name', + type: 'text', + isNullable: false, + }, + { + name: 'latitude', + type: 'float', + isNullable: false, + }, + { + name: 'longitude', + type: 'float', + isNullable: false, + }, + { + name: 'radius', + type: 'float', + isNullable: false, + }, + ], + }), + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropTable('chatroom'); + } +} -- cgit v1.2.3-70-g09d2