90dc-core 1.16.27 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ import { ProgressEntry } from './ProgressEntry.js';
5
5
  import type { Progress } from '../../models/ExerciseInterfaces.js';
6
6
  export declare class Exercise extends Model<Exercise> {
7
7
  uuid: string;
8
+ exerciseModelUuid?: string;
8
9
  name: string;
9
10
  order: number;
10
11
  progress: Progress[];
@@ -1 +1 @@
1
- {"version":3,"file":"Exercise.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/program/Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAA4D,MAAM,sBAAsB,CAAC;AACtH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEnE,qBACa,QAAS,SAAQ,KAAK,CAAC,QAAQ,CAAC;IAMnC,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAId,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,CAAC;IAGjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAK5B,WAAW,EAAE,MAAM,CAAC;IAKpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,eAAe,EAAE,aAAa,EAAE,CAAC;IAGjC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE1B,OAAO,EAAE,OAAO,CAAC;CAC1B"}
1
+ {"version":3,"file":"Exercise.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/program/Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAA4D,MAAM,sBAAsB,CAAC;AACtH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEnE,qBACa,QAAS,SAAQ,KAAK,CAAC,QAAQ,CAAC;IAMnC,IAAI,EAAE,MAAM,CAAC;IAKb,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAId,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,CAAC;IAGjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAK5B,WAAW,EAAE,MAAM,CAAC;IAKpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,eAAe,EAAE,aAAa,EAAE,CAAC;IAGjC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE1B,OAAO,EAAE,OAAO,CAAC;CAC1B"}
@@ -17,6 +17,13 @@ _ts_decorate([
17
17
  primaryKey: true
18
18
  })
19
19
  ], Exercise.prototype, "uuid", void 0);
20
+ _ts_decorate([
21
+ Index,
22
+ Column({
23
+ type: DataType.UUID,
24
+ allowNull: true
25
+ })
26
+ ], Exercise.prototype, "exerciseModelUuid", void 0);
20
27
  _ts_decorate([
21
28
  Column({
22
29
  type: DataType.STRING,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/dbmodels/program/Exercise.ts"],"sourcesContent":["import { Table, Column, Model, ForeignKey, Index, DataType, Default, HasMany, BelongsTo } from 'sequelize-typescript';\nimport { Workout } from './Workout.js';\nimport { Superset } from './Superset.js';\nimport { ProgressEntry } from './ProgressEntry.js';\nimport type { Progress } from '../../models/ExerciseInterfaces.js';\n\n@Table\nexport class Exercise extends Model<Exercise> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n primaryKey: true,\n })\n declare uuid: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare name: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare order: number;\n\n // DEPRECATED: Keep for backward compatibility during migration\n @Column({ type: DataType.ARRAY(DataType.JSONB), allowNull: true })\n declare progress: Progress[];\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare reps: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare sets: string;\n\n @Column({ type: DataType.STRING, allowNull: true })\n declare restTime: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare coachNote: string | null;\n\n @Column({ type: DataType.STRING(500), allowNull: true })\n declare thumbnailUrl: string | null;\n\n @Index\n @ForeignKey(() => Workout)\n @Column({ type: DataType.UUID, allowNull: false })\n declare workoutUuid: string;\n\n @Index\n @ForeignKey(() => Superset)\n @Column({ type: DataType.UUID, allowNull: true })\n declare supersetUuid: string | null;\n\n @HasMany(() => ProgressEntry)\n declare progressEntries: ProgressEntry[];\n\n @BelongsTo(() => Superset)\n declare superset: Superset | null;\n\n declare workout: Workout;\n}\n"],"names":["Table","Column","Model","ForeignKey","Index","DataType","Default","HasMany","BelongsTo","Workout","Superset","ProgressEntry","Exercise","UUIDV4","type","UUID","primaryKey","STRING","allowNull","INTEGER","ARRAY","JSONB","TEXT"],"mappings":";;;;;;AAAA,SAASA,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,SAAS,QAAQ,uBAAuB;AACtH,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,aAAa,QAAQ,qBAAqB;AAInD,OAAO,MAAMC,iBAAiBV;AAkD9B;;qBAjDoBW;;QAEhBC,MAAMT,SAASU,IAAI;QACnBC,YAAY;;;;;QAIJF,MAAMT,SAASY,MAAM;QAAEC,WAAW;;;;;QAGlCJ,MAAMT,SAASc,OAAO;QAAED,WAAW;;;;;QAInCJ,MAAMT,SAASe,KAAK,CAACf,SAASgB,KAAK;QAAGH,WAAW;;;;;QAGjDJ,MAAMT,SAASY,MAAM;QAAEC,WAAW;;;;;QAGlCJ,MAAMT,SAASY,MAAM;QAAEC,WAAW;;;;;QAGlCJ,MAAMT,SAASY,MAAM;QAAEC,WAAW;;;;;QAGlCJ,MAAMT,SAASiB,IAAI;QAAEJ,WAAW;;;;;QAGhCJ,MAAMT,SAASY,MAAM,CAAC;QAAMC,WAAW;;;;;mBAI/BT;;QACRK,MAAMT,SAASU,IAAI;QAAEG,WAAW;;;;;mBAIxBR;;QACRI,MAAMT,SAASU,IAAI;QAAEG,WAAW;;;;gBAG3BP;;;kBAGED"}
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/program/Exercise.ts"],"sourcesContent":["import { Table, Column, Model, ForeignKey, Index, DataType, Default, HasMany, BelongsTo } from 'sequelize-typescript';\nimport { Workout } from './Workout.js';\nimport { Superset } from './Superset.js';\nimport { ProgressEntry } from './ProgressEntry.js';\nimport type { Progress } from '../../models/ExerciseInterfaces.js';\n\n@Table\nexport class Exercise extends Model<Exercise> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n primaryKey: true,\n })\n declare uuid: string;\n\n // Programs v2: Reference to ExerciseModel for latest video/instructions\n @Index\n @Column({ type: DataType.UUID, allowNull: true })\n declare exerciseModelUuid?: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare name: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare order: number;\n\n // DEPRECATED: Keep for backward compatibility during migration\n @Column({ type: DataType.ARRAY(DataType.JSONB), allowNull: true })\n declare progress: Progress[];\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare reps: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare sets: string;\n\n @Column({ type: DataType.STRING, allowNull: true })\n declare restTime: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare coachNote: string | null;\n\n @Column({ type: DataType.STRING(500), allowNull: true })\n declare thumbnailUrl: string | null;\n\n @Index\n @ForeignKey(() => Workout)\n @Column({ type: DataType.UUID, allowNull: false })\n declare workoutUuid: string;\n\n @Index\n @ForeignKey(() => Superset)\n @Column({ type: DataType.UUID, allowNull: true })\n declare supersetUuid: string | null;\n\n @HasMany(() => ProgressEntry)\n declare progressEntries: ProgressEntry[];\n\n @BelongsTo(() => Superset)\n declare superset: Superset | null;\n\n declare workout: Workout;\n}\n"],"names":["Table","Column","Model","ForeignKey","Index","DataType","Default","HasMany","BelongsTo","Workout","Superset","ProgressEntry","Exercise","UUIDV4","type","UUID","primaryKey","allowNull","STRING","INTEGER","ARRAY","JSONB","TEXT"],"mappings":";;;;;;AAAA,SAASA,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,SAAS,QAAQ,uBAAuB;AACtH,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,aAAa,QAAQ,qBAAqB;AAInD,OAAO,MAAMC,iBAAiBV;AAuD9B;;qBAtDoBW;;QAEhBC,MAAMT,SAASU,IAAI;QACnBC,YAAY;;;;;;QAMJF,MAAMT,SAASU,IAAI;QAAEE,WAAW;;;;;QAGhCH,MAAMT,SAASa,MAAM;QAAED,WAAW;;;;;QAGlCH,MAAMT,SAASc,OAAO;QAAEF,WAAW;;;;;QAInCH,MAAMT,SAASe,KAAK,CAACf,SAASgB,KAAK;QAAGJ,WAAW;;;;;QAGjDH,MAAMT,SAASa,MAAM;QAAED,WAAW;;;;;QAGlCH,MAAMT,SAASa,MAAM;QAAED,WAAW;;;;;QAGlCH,MAAMT,SAASa,MAAM;QAAED,WAAW;;;;;QAGlCH,MAAMT,SAASiB,IAAI;QAAEL,WAAW;;;;;QAGhCH,MAAMT,SAASa,MAAM,CAAC;QAAMD,WAAW;;;;;mBAI/BR;;QACRK,MAAMT,SAASU,IAAI;QAAEE,WAAW;;;;;mBAIxBP;;QACRI,MAAMT,SAASU,IAAI;QAAEE,WAAW;;;;gBAG3BN;;;kBAGED"}
@@ -16,6 +16,7 @@ export interface ProgressFieldValue {
16
16
  export declare class ProgressEntry extends Model<ProgressEntry> {
17
17
  uuid: string;
18
18
  exerciseUuid: string;
19
+ exerciseModelUuid?: string;
19
20
  recordedAt: Date;
20
21
  setNumber: number;
21
22
  fields: ProgressFieldValue[];
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressEntry.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/program/ProgressEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,EAAkD,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,oBAAY,iBAAiB;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,OAAO,YAAY;CACtB;AAED,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,qBACa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC;IAM3C,IAAI,EAAE,MAAM,CAAC;IAQb,YAAY,EAAE,MAAM,CAAC;IAOrB,UAAU,EAAE,IAAI,CAAC;IAOjB,SAAS,EAAE,MAAM,CAAC;IAOlB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAM7B,YAAY,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI,CAAC;IAG5C,QAAQ,EAAE,QAAQ,CAAC;CAC9B"}
1
+ {"version":3,"file":"ProgressEntry.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/program/ProgressEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,EAAkD,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,oBAAY,iBAAiB;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,OAAO,YAAY;CACtB;AAED,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,qBACa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC;IAM3C,IAAI,EAAE,MAAM,CAAC;IAQb,YAAY,EAAE,MAAM,CAAC;IAQrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAO3B,UAAU,EAAE,IAAI,CAAC;IAOjB,SAAS,EAAE,MAAM,CAAC;IAOlB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAM7B,YAAY,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI,CAAC;IAG5C,QAAQ,EAAE,QAAQ,CAAC;CAC9B"}
@@ -31,6 +31,13 @@ _ts_decorate([
31
31
  allowNull: false
32
32
  })
33
33
  ], ProgressEntry.prototype, "exerciseUuid", void 0);
34
+ _ts_decorate([
35
+ Index,
36
+ Column({
37
+ type: DataType.UUID,
38
+ allowNull: true
39
+ })
40
+ ], ProgressEntry.prototype, "exerciseModelUuid", void 0);
34
41
  _ts_decorate([
35
42
  Index,
36
43
  Column({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/dbmodels/program/ProgressEntry.ts"],"sourcesContent":["import {Table, Column, Model, ForeignKey, Index, DataType, Default, BelongsTo} from 'sequelize-typescript';\nimport {Exercise} from \"./Exercise.js\";\n\nexport enum ProgressFieldType {\n NUMBER = 'number',\n TEXT = 'text',\n SELECT = 'select',\n TIME = 'time',\n BOOLEAN = 'boolean'\n}\n\nexport interface ProgressFieldValue {\n fieldName: string;\n fieldType: ProgressFieldType;\n value: string | number | boolean;\n options?: string[];\n}\n\n@Table({ timestamps: true })\nexport class ProgressEntry extends Model<ProgressEntry> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n primaryKey: true,\n })\n declare uuid: string;\n\n @Index\n @ForeignKey(() => Exercise)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare exerciseUuid: string;\n\n @Index\n @Column({\n type: DataType.DATE,\n allowNull: false,\n })\n declare recordedAt: Date;\n\n @Column({\n type: DataType.INTEGER,\n allowNull: false,\n defaultValue: 1,\n })\n declare setNumber: number;\n\n @Column({\n type: DataType.JSONB,\n allowNull: false,\n defaultValue: [],\n })\n declare fields: ProgressFieldValue[];\n\n @Column({\n type: DataType.STRING,\n allowNull: true,\n })\n declare metricSystem?: 'Metric' | 'Imperial' | null;\n\n @BelongsTo(() => Exercise)\n declare exercise: Exercise;\n}\n"],"names":["Table","Column","Model","ForeignKey","Index","DataType","Default","BelongsTo","Exercise","ProgressFieldType","ProgressEntry","UUIDV4","type","UUID","primaryKey","allowNull","DATE","INTEGER","defaultValue","JSONB","STRING","timestamps"],"mappings":";;;;;;AAAA,SAAQA,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,SAAS,QAAO,uBAAuB;AAC3G,SAAQC,QAAQ,QAAO,gBAAgB;AAEvC,OAAO,IAAA,AAAKC,2CAAAA;;;;;;WAAAA;MAMX;AAUD,OAAO,MAAMC,sBAAsBR;AA6CnC;;qBA5CsBS;;QAEdC,MAAMP,SAASQ,IAAI;QACnBC,YAAY;;;;;mBAKEN;;QAEdI,MAAMP,SAASQ,IAAI;QACnBE,WAAW;;;;;;QAMXH,MAAMP,SAASW,IAAI;QACnBD,WAAW;;;;;QAKXH,MAAMP,SAASY,OAAO;QACtBF,WAAW;QACXG,cAAc;;;;;QAKdN,MAAMP,SAASc,KAAK;QACpBJ,WAAW;QACXG,cAAc,EAAE;;;;;QAKhBN,MAAMP,SAASe,MAAM;QACrBL,WAAW;;;;kBAIEP;;;;QA5CZa,YAAY"}
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/program/ProgressEntry.ts"],"sourcesContent":["import {Table, Column, Model, ForeignKey, Index, DataType, Default, BelongsTo} from 'sequelize-typescript';\nimport {Exercise} from \"./Exercise.js\";\n\nexport enum ProgressFieldType {\n NUMBER = 'number',\n TEXT = 'text',\n SELECT = 'select',\n TIME = 'time',\n BOOLEAN = 'boolean'\n}\n\nexport interface ProgressFieldValue {\n fieldName: string;\n fieldType: ProgressFieldType;\n value: string | number | boolean;\n options?: string[];\n}\n\n@Table({ timestamps: true })\nexport class ProgressEntry extends Model<ProgressEntry> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n primaryKey: true,\n })\n declare uuid: string;\n\n @Index\n @ForeignKey(() => Exercise)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare exerciseUuid: string;\n\n // Programs v2: Reference to ExerciseModel for historical aggregation\n @Index\n @Column({\n type: DataType.UUID,\n allowNull: true,\n })\n declare exerciseModelUuid?: string;\n\n @Index\n @Column({\n type: DataType.DATE,\n allowNull: false,\n })\n declare recordedAt: Date;\n\n @Column({\n type: DataType.INTEGER,\n allowNull: false,\n defaultValue: 1,\n })\n declare setNumber: number;\n\n @Column({\n type: DataType.JSONB,\n allowNull: false,\n defaultValue: [],\n })\n declare fields: ProgressFieldValue[];\n\n @Column({\n type: DataType.STRING,\n allowNull: true,\n })\n declare metricSystem?: 'Metric' | 'Imperial' | null;\n\n @BelongsTo(() => Exercise)\n declare exercise: Exercise;\n}\n"],"names":["Table","Column","Model","ForeignKey","Index","DataType","Default","BelongsTo","Exercise","ProgressFieldType","ProgressEntry","UUIDV4","type","UUID","primaryKey","allowNull","DATE","INTEGER","defaultValue","JSONB","STRING","timestamps"],"mappings":";;;;;;AAAA,SAAQA,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,SAAS,QAAO,uBAAuB;AAC3G,SAAQC,QAAQ,QAAO,gBAAgB;AAEvC,OAAO,IAAA,AAAKC,2CAAAA;;;;;;WAAAA;MAMX;AAUD,OAAO,MAAMC,sBAAsBR;AAqDnC;;qBApDsBS;;QAEdC,MAAMP,SAASQ,IAAI;QACnBC,YAAY;;;;;mBAKEN;;QAEdI,MAAMP,SAASQ,IAAI;QACnBE,WAAW;;;;;;QAOXH,MAAMP,SAASQ,IAAI;QACnBE,WAAW;;;;;;QAMXH,MAAMP,SAASW,IAAI;QACnBD,WAAW;;;;;QAKXH,MAAMP,SAASY,OAAO;QACtBF,WAAW;QACXG,cAAc;;;;;QAKdN,MAAMP,SAASc,KAAK;QACpBJ,WAAW;QACXG,cAAc,EAAE;;;;;QAKhBN,MAAMP,SAASe,MAAM;QACrBL,WAAW;;;;kBAIEP;;;;QApDZa,YAAY"}
@@ -1,7 +1,8 @@
1
1
  // Sequelize CLI Configuration for Migrations and Seeders
2
2
  // This config is used by sequelize-cli for running migrations and seeders
3
3
 
4
- require('dotenv').config();
4
+ const path = require('path');
5
+ require('dotenv').config({ path: path.resolve(__dirname, '../../../.env') });
5
6
 
6
7
  module.exports = {
7
8
  development: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.16.27",
3
+ "version": "1.17.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,21 +0,0 @@
1
- /**
2
- * Migration: Create PostgreSQL Extensions
3
- * Creates necessary PostgreSQL extensions for the application
4
- */ 'use strict';
5
- module.exports = {
6
- async up (queryInterface, Sequelize) {
7
- // Create UUID extension
8
- await queryInterface.sequelize.query('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";');
9
- // Create trigram extension for text search
10
- await queryInterface.sequelize.query('CREATE EXTENSION IF NOT EXISTS "pg_trgm";');
11
- console.log('✅ PostgreSQL extensions created successfully');
12
- },
13
- async down (queryInterface, Sequelize) {
14
- // Drop extensions (careful with this in production!)
15
- await queryInterface.sequelize.query('DROP EXTENSION IF EXISTS "pg_trgm";');
16
- await queryInterface.sequelize.query('DROP EXTENSION IF EXISTS "uuid-ossp";');
17
- console.log('✅ PostgreSQL extensions dropped');
18
- }
19
- };
20
-
21
- //# sourceMappingURL=20250117000001-create-extensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/lib/scripts/migrations/20250117000001-create-extensions.js"],"sourcesContent":["/**\n * Migration: Create PostgreSQL Extensions\n * Creates necessary PostgreSQL extensions for the application\n */\n\n'use strict';\n\nmodule.exports = {\n async up(queryInterface, Sequelize) {\n // Create UUID extension\n await queryInterface.sequelize.query(\n 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'\n );\n\n // Create trigram extension for text search\n await queryInterface.sequelize.query(\n 'CREATE EXTENSION IF NOT EXISTS \"pg_trgm\";'\n );\n\n console.log('✅ PostgreSQL extensions created successfully');\n },\n\n async down(queryInterface, Sequelize) {\n // Drop extensions (careful with this in production!)\n await queryInterface.sequelize.query(\n 'DROP EXTENSION IF EXISTS \"pg_trgm\";'\n );\n\n await queryInterface.sequelize.query(\n 'DROP EXTENSION IF EXISTS \"uuid-ossp\";'\n );\n\n console.log('✅ PostgreSQL extensions dropped');\n }\n};\n"],"names":["module","exports","up","queryInterface","Sequelize","sequelize","query","console","log","down"],"mappings":"AAAA;;;CAGC,GAED;AAEAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,cAAc,EAAEC,SAAS;QAChC,wBAAwB;QACxB,MAAMD,eAAeE,SAAS,CAACC,KAAK,CAClC;QAGF,2CAA2C;QAC3C,MAAMH,eAAeE,SAAS,CAACC,KAAK,CAClC;QAGFC,QAAQC,GAAG,CAAC;IACd;IAEA,MAAMC,MAAKN,cAAc,EAAEC,SAAS;QAClC,qDAAqD;QACrD,MAAMD,eAAeE,SAAS,CAACC,KAAK,CAClC;QAGF,MAAMH,eAAeE,SAAS,CAACC,KAAK,CAClC;QAGFC,QAAQC,GAAG,CAAC;IACd;AACF"}
@@ -1,41 +0,0 @@
1
- /**
2
- * Migration: Add Index on Exercises.supersetUuid
3
- * Improves performance of UPDATE queries that filter by supersetUuid
4
- *
5
- * This index is critical for queries like:
6
- * UPDATE "Exercises" SET "supersetUuid"=$1 WHERE "supersetUuid" = $2
7
- *
8
- * Without this index, the query performs a full table scan which can take 11+ minutes
9
- * With the index, it should complete in milliseconds
10
- */ 'use strict';
11
- module.exports = {
12
- async up (queryInterface, Sequelize) {
13
- console.log('🔄 Creating index on Exercises.supersetUuid...');
14
- // Check if index already exists to make migration idempotent
15
- const [results] = await queryInterface.sequelize.query(`
16
- SELECT indexname
17
- FROM pg_indexes
18
- WHERE tablename = 'Exercises'
19
- AND indexname = 'exercises_superset_uuid';
20
- `);
21
- if (results.length > 0) {
22
- console.log('✅ Index exercises_superset_uuid already exists, skipping...');
23
- return;
24
- }
25
- // Create index on supersetUuid column
26
- await queryInterface.addIndex('Exercises', [
27
- 'supersetUuid'
28
- ], {
29
- name: 'exercises_superset_uuid',
30
- using: 'BTREE'
31
- });
32
- console.log('✅ Index on Exercises.supersetUuid created successfully');
33
- },
34
- async down (queryInterface, Sequelize) {
35
- console.log('🔄 Dropping index on Exercises.supersetUuid...');
36
- await queryInterface.removeIndex('Exercises', 'exercises_superset_uuid');
37
- console.log('✅ Index on Exercises.supersetUuid dropped');
38
- }
39
- };
40
-
41
- //# sourceMappingURL=20250126000001-add-index-exercises-supersetUuid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/lib/scripts/migrations/20250126000001-add-index-exercises-supersetUuid.js"],"sourcesContent":["/**\n * Migration: Add Index on Exercises.supersetUuid\n * Improves performance of UPDATE queries that filter by supersetUuid\n *\n * This index is critical for queries like:\n * UPDATE \"Exercises\" SET \"supersetUuid\"=$1 WHERE \"supersetUuid\" = $2\n *\n * Without this index, the query performs a full table scan which can take 11+ minutes\n * With the index, it should complete in milliseconds\n */\n\n'use strict';\n\nmodule.exports = {\n async up(queryInterface, Sequelize) {\n console.log('🔄 Creating index on Exercises.supersetUuid...');\n\n // Check if index already exists to make migration idempotent\n const [results] = await queryInterface.sequelize.query(`\n SELECT indexname\n FROM pg_indexes\n WHERE tablename = 'Exercises'\n AND indexname = 'exercises_superset_uuid';\n `);\n\n if (results.length > 0) {\n console.log('✅ Index exercises_superset_uuid already exists, skipping...');\n return;\n }\n\n // Create index on supersetUuid column\n await queryInterface.addIndex('Exercises', ['supersetUuid'], {\n name: 'exercises_superset_uuid',\n using: 'BTREE',\n });\n\n console.log('✅ Index on Exercises.supersetUuid created successfully');\n },\n\n async down(queryInterface, Sequelize) {\n console.log('🔄 Dropping index on Exercises.supersetUuid...');\n\n await queryInterface.removeIndex('Exercises', 'exercises_superset_uuid');\n\n console.log('✅ Index on Exercises.supersetUuid dropped');\n }\n};\n"],"names":["module","exports","up","queryInterface","Sequelize","console","log","results","sequelize","query","length","addIndex","name","using","down","removeIndex"],"mappings":"AAAA;;;;;;;;;CASC,GAED;AAEAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,cAAc,EAAEC,SAAS;QAChCC,QAAQC,GAAG,CAAC;QAEZ,6DAA6D;QAC7D,MAAM,CAACC,QAAQ,GAAG,MAAMJ,eAAeK,SAAS,CAACC,KAAK,CAAC,CAAC;;;;;IAKxD,CAAC;QAED,IAAIF,QAAQG,MAAM,GAAG,GAAG;YACtBL,QAAQC,GAAG,CAAC;YACZ;QACF;QAEA,sCAAsC;QACtC,MAAMH,eAAeQ,QAAQ,CAAC,aAAa;YAAC;SAAe,EAAE;YAC3DC,MAAM;YACNC,OAAO;QACT;QAEAR,QAAQC,GAAG,CAAC;IACd;IAEA,MAAMQ,MAAKX,cAAc,EAAEC,SAAS;QAClCC,QAAQC,GAAG,CAAC;QAEZ,MAAMH,eAAeY,WAAW,CAAC,aAAa;QAE9CV,QAAQC,GAAG,CAAC;IACd;AACF"}
@@ -1,45 +0,0 @@
1
- /**
2
- * Migration: Add Partial Unique Constraint on WorkoutSessions
3
- * Ensures only one ACTIVE session exists per workout, while allowing multiple COMPLETED sessions
4
- *
5
- * This is critical for circular programs where workouts repeat across cycles.
6
- * Each cycle can have its own session history, but only one can be active at a time.
7
- *
8
- * Before: No constraint, relied on application logic (findOne)
9
- * After: Database-level constraint prevents duplicate active sessions
10
- */ 'use strict';
11
- module.exports = {
12
- async up (queryInterface, Sequelize) {
13
- console.log('🔄 Creating partial unique constraint on WorkoutSessions...');
14
- // Check if index already exists to make migration idempotent
15
- const [results] = await queryInterface.sequelize.query(`
16
- SELECT indexname
17
- FROM pg_indexes
18
- WHERE tablename = 'WorkoutSessions'
19
- AND indexname = 'unique_active_session_per_workout';
20
- `);
21
- if (results.length > 0) {
22
- console.log('✅ Constraint unique_active_session_per_workout already exists, skipping...');
23
- return;
24
- }
25
- // Add partial unique index: only one active session per workout
26
- await queryInterface.addIndex('WorkoutSessions', [
27
- 'workoutUuid',
28
- 'status'
29
- ], {
30
- unique: true,
31
- name: 'unique_active_session_per_workout',
32
- where: {
33
- status: 'active'
34
- }
35
- });
36
- console.log('✅ Partial unique constraint on WorkoutSessions created successfully');
37
- },
38
- async down (queryInterface, Sequelize) {
39
- console.log('🔄 Dropping partial unique constraint on WorkoutSessions...');
40
- await queryInterface.removeIndex('WorkoutSessions', 'unique_active_session_per_workout');
41
- console.log('✅ Constraint on WorkoutSessions dropped');
42
- }
43
- };
44
-
45
- //# sourceMappingURL=20260115000000-add-workout-session-unique-constraint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/lib/scripts/migrations/20260115000000-add-workout-session-unique-constraint.js"],"sourcesContent":["/**\n * Migration: Add Partial Unique Constraint on WorkoutSessions\n * Ensures only one ACTIVE session exists per workout, while allowing multiple COMPLETED sessions\n *\n * This is critical for circular programs where workouts repeat across cycles.\n * Each cycle can have its own session history, but only one can be active at a time.\n *\n * Before: No constraint, relied on application logic (findOne)\n * After: Database-level constraint prevents duplicate active sessions\n */\n\n'use strict';\n\nmodule.exports = {\n async up(queryInterface, Sequelize) {\n console.log('🔄 Creating partial unique constraint on WorkoutSessions...');\n\n // Check if index already exists to make migration idempotent\n const [results] = await queryInterface.sequelize.query(`\n SELECT indexname\n FROM pg_indexes\n WHERE tablename = 'WorkoutSessions'\n AND indexname = 'unique_active_session_per_workout';\n `);\n\n if (results.length > 0) {\n console.log('✅ Constraint unique_active_session_per_workout already exists, skipping...');\n return;\n }\n\n // Add partial unique index: only one active session per workout\n await queryInterface.addIndex('WorkoutSessions', ['workoutUuid', 'status'], {\n unique: true,\n name: 'unique_active_session_per_workout',\n where: {\n status: 'active'\n }\n });\n\n console.log('✅ Partial unique constraint on WorkoutSessions created successfully');\n },\n\n async down(queryInterface, Sequelize) {\n console.log('🔄 Dropping partial unique constraint on WorkoutSessions...');\n\n await queryInterface.removeIndex('WorkoutSessions', 'unique_active_session_per_workout');\n\n console.log('✅ Constraint on WorkoutSessions dropped');\n }\n};\n"],"names":["module","exports","up","queryInterface","Sequelize","console","log","results","sequelize","query","length","addIndex","unique","name","where","status","down","removeIndex"],"mappings":"AAAA;;;;;;;;;CASC,GAED;AAEAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,cAAc,EAAEC,SAAS;QAChCC,QAAQC,GAAG,CAAC;QAEZ,6DAA6D;QAC7D,MAAM,CAACC,QAAQ,GAAG,MAAMJ,eAAeK,SAAS,CAACC,KAAK,CAAC,CAAC;;;;;IAKxD,CAAC;QAED,IAAIF,QAAQG,MAAM,GAAG,GAAG;YACtBL,QAAQC,GAAG,CAAC;YACZ;QACF;QAEA,gEAAgE;QAChE,MAAMH,eAAeQ,QAAQ,CAAC,mBAAmB;YAAC;YAAe;SAAS,EAAE;YAC1EC,QAAQ;YACRC,MAAM;YACNC,OAAO;gBACLC,QAAQ;YACV;QACF;QAEAV,QAAQC,GAAG,CAAC;IACd;IAEA,MAAMU,MAAKb,cAAc,EAAEC,SAAS;QAClCC,QAAQC,GAAG,CAAC;QAEZ,MAAMH,eAAec,WAAW,CAAC,mBAAmB;QAEpDZ,QAAQC,GAAG,CAAC;IACd;AACF"}