feat: Android APP V1 - Experimental Alpha
This commit is contained in:
23
server/src/migrations/1000000000010-DeviceTokens.ts
Normal file
23
server/src/migrations/1000000000010-DeviceTokens.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class DeviceTokens1000000000010 implements MigrationInterface {
|
||||
name = 'DeviceTokens1000000000010';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
CREATE TABLE IF NOT EXISTS "device_tokens" (
|
||||
"id" TEXT PRIMARY KEY NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"platform" TEXT NOT NULL,
|
||||
"token" TEXT NOT NULL,
|
||||
"updatedAt" INTEGER NOT NULL
|
||||
)
|
||||
`);
|
||||
|
||||
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "idx_device_tokens_user_id" ON "device_tokens" ("userId")`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`DROP TABLE IF EXISTS "device_tokens"`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user