diff --git a/android/app/build.gradle b/android/app/build.gradle index 61193ca..2eee223 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -85,8 +85,8 @@ android { applicationId "com.massive" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 36198 - versionName "1.172" + versionCode 36199 + versionName "1.173" } signingConfigs { release { diff --git a/data-source.ts b/data-source.ts index 8d5735e..1845b5d 100644 --- a/data-source.ts +++ b/data-source.ts @@ -31,6 +31,7 @@ import { Plan } from "./plan"; import Settings from "./settings"; import Weight from "./weight"; import { exercises1699508495726 } from "./migrations/1699508495726-exercises"; +import { exercisesFix1699613077628 } from "./migrations/1699613077628-exercises-fix"; export const AppDataSource = new DataSource({ type: "react-native", @@ -68,5 +69,6 @@ export const AppDataSource = new DataSource({ planTitle1692654882408, weight1697766633971, exercises1699508495726, + exercisesFix1699613077628, ], }); diff --git a/migrations/1699613077628-exercises-fix.ts b/migrations/1699613077628-exercises-fix.ts new file mode 100644 index 0000000..69bf0cf --- /dev/null +++ b/migrations/1699613077628-exercises-fix.ts @@ -0,0 +1,43 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class exercisesFix1699613077628 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + CREATE TABLE plans_temp ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + days TEXT NOT NULL, + workouts TEXT NOT NULL, + title TEXT + ) + `); + + await queryRunner.query(` + INSERT INTO plans_temp (id,days,workouts,title) + SELECT id,days,workouts,title + FROM plans + `); + + await queryRunner.query(` + DROP TABLE plans + `); + + await queryRunner.query(` + CREATE TABLE plans ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + days TEXT NOT NULL, + exercises TEXT NOT NULL, + title TEXT + ) + `); + + await queryRunner.query(` + INSERT INTO plans (id,days,exercises,title) + SELECT id,days,workouts,title + FROM plans_temp + `); + + await queryRunner.query(`DROP TABLE plans_temp`); + } + + public async down(queryRunner: QueryRunner): Promise {} +} diff --git a/package.json b/package.json index bfb13ec..834cafb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "massive", - "version": "1.172", + "version": "1.173", "private": true, "license": "GPL-3.0-only", "scripts": {