2022-10-31 04:21:28 +00:00
|
|
|
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:21:28 +00:00
|
|
|
`)
|
2022-10-31 04:05:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
2022-10-31 04:21:28 +00:00
|
|
|
await queryRunner.query(`DROP TABLE sets`)
|
2022-10-31 04:05:31 +00:00
|
|
|
}
|
|
|
|
}
|