Massive/migrations/1667185586014-sets.ts

21 lines
585 B
TypeScript
Raw Normal View History

import {MigrationInterface, QueryRunner} from 'typeorm'
2022-10-31 04:05:31 +00:00
export class Sets1667185586014 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TABLE IF NOT EXISTS sets (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
reps INTEGER NOT NULL,
weight INTEGER NOT NULL,
created TEXT NOT NULL,
unit TEXT DEFAULT 'kg'
)
`)
2022-10-31 04:05:31 +00:00
}
public async down(queryRunner: QueryRunner): Promise<void> {
2022-11-01 07:00:24 +00:00
await queryRunner.query('DROP TABLE sets')
2022-10-31 04:05:31 +00:00
}
}