summaryrefslogtreecommitdiff
path: root/server/database
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2022-03-29 20:17:08 -0600
committerLogan Hunt <loganhunt@simponic.xyz>2022-03-29 20:17:08 -0600
commit042e3b9862b253fb3c3e59ee628dd9e30edf7e35 (patch)
treec05008b3c9c3af133ff6ac7618b88f86dfd71038 /server/database
parent5e2996c0fdeee2eaa88a72f79d2e0d600edeb5a6 (diff)
downloadlocchat-042e3b9862b253fb3c3e59ee628dd9e30edf7e35.tar.gz
locchat-042e3b9862b253fb3c3e59ee628dd9e30edf7e35.zip
Chatrooms created
Diffstat (limited to 'server/database')
-rw-r--r--server/database/migrations/1648605030863-AddChatRoom.ts43
1 files changed, 43 insertions, 0 deletions
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<void> {
+ 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<void> {
+ await queryRunner.dropTable('chatroom');
+ }
+}