From db75c17c320496ef02be9c68fdc1ecb7749679b3 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 8 May 2026 11:10:29 +0200 Subject: [PATCH 01/55] Slightly increase the maximum workout duration --- lib/models/workouts/routine.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/workouts/routine.dart b/lib/models/workouts/routine.dart index fdca5c97a..ad20d76e5 100644 --- a/lib/models/workouts/routine.dart +++ b/lib/models/workouts/routine.dart @@ -37,7 +37,7 @@ class Routine { /// In weeks static const MIN_DURATION = 2; - static const MAX_DURATION = 16; + static const MAX_DURATION = 17; static const DEFAULT_DURATION = 12; @JsonKey(required: true, includeToJson: false) From 6831ee73dd35c3b2c3ee274aba46c154063e7a2f Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 8 May 2026 15:13:43 +0200 Subject: [PATCH 02/55] Set explicit permissions for all workflows --- .github/workflows/analyze.yml | 3 +++ .github/workflows/build-android.yml | 4 ++++ .github/workflows/build-apple.yml | 4 ++++ .github/workflows/build-linux.yml | 4 ++++ .github/workflows/build-windows.yml | 4 ++++ .github/workflows/bump-version.yml | 3 +++ .github/workflows/ci.yml | 3 +++ .github/workflows/make-release.yml | 7 +++++++ .github/workflows/screenshots.yml | 5 +++++ 9 files changed, 37 insertions(+) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 0a74ff7f3..e66916e9d 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -16,6 +16,9 @@ on: workflow_call: workflow_dispatch: +permissions: + contents: read + jobs: analyze: name: Run analyzer diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 0ad621313..da249ed40 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -16,6 +16,10 @@ on: required: true DECRYPTKEY_PROPERTIES: required: true + +permissions: + contents: read + jobs: build_android_apk: name: APK file diff --git a/.github/workflows/build-apple.yml b/.github/workflows/build-apple.yml index 1bb893adf..d95e5783c 100644 --- a/.github/workflows/build-apple.yml +++ b/.github/workflows/build-apple.yml @@ -11,6 +11,10 @@ on: ref: required: true type: string + +permissions: + contents: read + jobs: build_ios: name: iOS diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 3958f0067..435efe115 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -21,6 +21,10 @@ on: secrets: SSH_DEPLOY_KEY: required: true + +permissions: + contents: read + jobs: # TODO: note that we currently only build for x64, as arm64 is not supported by diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index e4a8995a0..0956ef8df 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -11,6 +11,10 @@ on: ref: required: true type: string + +permissions: + contents: read + jobs: # TODO: we currently upload the release folder as a ZIP, which works as a # portable version. For a proper installer (e.g. via Inno Setup or MSIX), diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index eade216d9..c595dd6d4 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -6,6 +6,9 @@ on: required: true type: string +permissions: + contents: write + jobs: determine_version: name: Create tag diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1c1235f5..a891b1d99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,9 @@ on: workflow_call: workflow_dispatch: +permissions: + contents: read + jobs: test: name: Run tests diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index b77341b2a..5ae21bd3c 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -7,6 +7,9 @@ on: required: true type: string +permissions: + contents: read + jobs: ci: @@ -16,6 +19,8 @@ jobs: determine_version: needs: ci name: Prepare + permissions: + contents: write uses: ./.github/workflows/bump-version.yml with: app_version: ${{ github.event.inputs.version }} @@ -126,6 +131,8 @@ jobs: make_gh_release: name: Make Github Release runs-on: ubuntu-latest + permissions: + contents: write needs: - upload_play_store - build_linux diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index ae05cc3d5..d28333fcc 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -7,6 +7,9 @@ on: type: boolean default: false +permissions: + contents: read + jobs: screenshots_apple: name: 'iOS' @@ -131,6 +134,8 @@ jobs: - screenshots_android runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v6 From a3481b9d997dc3a5294c5c03261cab9b17652978 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 8 May 2026 15:19:03 +0200 Subject: [PATCH 03/55] Add codeQL scanning workflow --- .github/workflows/codeql-analysis.yml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..b24b71894 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,40 @@ +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + schedule: + - cron: '44 6 * * 6' # Every Saturday at 6:44 UTC + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'actions' ] + # Supported languages https://git.io/codeql-language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v4 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 From b2ab00e62ffd107d4930bbbc63e76ebf26d2cd8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 00:57:28 +0000 Subject: [PATCH 04/55] Bump flutter_svg from 2.2.4 to 2.3.0 Bumps [flutter_svg](https://github.com/flutter/packages/tree/main/third_party/packages) from 2.2.4 to 2.3.0. - [Commits](https://github.com/flutter/packages/commits/flutter_svg-v2.3.0/third_party/packages) --- updated-dependencies: - dependency-name: flutter_svg dependency-version: 2.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pubspec.lock | 8 ++++---- pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 708c4c7b8..a608a9315 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -500,10 +500,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: "1ded017b39c8e15c8948ea855070a5ff8ff8b3d5e83f3446e02d6bb12add7ad9" + sha256: "35882981abcbfb8c15b286f0cd690ff25bac12d95eff3e25ee207f37d4c42e7f" url: "https://pub.dev" source: hosted - version: "2.2.4" + version: "2.3.0" flutter_svg_icons: dependency: "direct main" description: @@ -1485,10 +1485,10 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "81da85e9ca8885ade47f9685b953cb098970d11be4821ac765580a6607ea4373" + sha256: "6409a25046024f0f8c5d8a59fec314081e81f9d436b66ca4015a8b49772bf445" url: "https://pub.dev" source: hosted - version: "1.1.21" + version: "1.2.0" vector_graphics_codec: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2fe7c6e17..288b261de 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -43,7 +43,7 @@ dependencies: flutter_html: ^3.0.0 flutter_riverpod: ^3.3.1 flutter_staggered_grid_view: ^0.7.0 - flutter_svg: ^2.2.4 + flutter_svg: ^2.3.0 flutter_svg_icons: ^0.0.1 flutter_typeahead: ^6.0.0 flutter_zxing: ^2.2.1 From 944b27e38e34adc48c512cdd83437956a8f677a3 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 15 May 2026 13:03:16 +0200 Subject: [PATCH 05/55] Also sync all the license information, even if we don't expose all of that right now --- .../exercise_image_style_converter.dart | 32 + lib/database/powersync/database.dart | 1 + lib/database/powersync/database.g.dart | 1366 ++++++++++++++++- lib/database/powersync/tables/exercise.dart | 51 +- lib/database/powersync/tables/ingredient.dart | 13 +- lib/models/exercises/image.dart | 50 + lib/models/exercises/video.dart | 23 +- lib/models/nutrition/ingredient_image.dart | 24 +- lib/models/nutrition/ingredient_image.g.dart | 14 +- lib/providers/gym_state.g.dart | 2 +- lib/widgets/measurements/forms.dart | 3 +- test/exercises/exercise_repository_test.dart | 10 + .../nutrition/ingredient_repository_test.dart | 6 +- test/nutrition/nutrition_repository_test.dart | 5 +- 14 files changed, 1560 insertions(+), 40 deletions(-) create mode 100644 lib/database/converters/exercise_image_style_converter.dart diff --git a/lib/database/converters/exercise_image_style_converter.dart b/lib/database/converters/exercise_image_style_converter.dart new file mode 100644 index 000000000..c1e9377ff --- /dev/null +++ b/lib/database/converters/exercise_image_style_converter.dart @@ -0,0 +1,32 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020 - 2026 wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:drift/drift.dart'; +import 'package:wger/models/exercises/image.dart'; + +/// Maps an [ExerciseImageStyle] to and from the Django wire format +/// (`'1'`–`'5'`). +class ExerciseImageStyleConverter extends TypeConverter { + const ExerciseImageStyleConverter(); + + @override + ExerciseImageStyle fromSql(String fromDb) => ExerciseImageStyle.fromWire(fromDb); + + @override + String toSql(ExerciseImageStyle value) => value.wireValue; +} diff --git a/lib/database/powersync/database.dart b/lib/database/powersync/database.dart index b9367475c..dc0b7612d 100644 --- a/lib/database/powersync/database.dart +++ b/lib/database/powersync/database.dart @@ -21,6 +21,7 @@ import 'package:drift_sqlite_async/drift_sqlite_async.dart'; import 'package:flutter/material.dart' show TimeOfDay; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:powersync/powersync.dart' as ps; +import 'package:wger/database/converters/exercise_image_style_converter.dart'; import 'package:wger/database/converters/time_of_day_converter.dart'; import 'package:wger/database/converters/workout_impression_converter.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; diff --git a/lib/database/powersync/database.g.dart b/lib/database/powersync/database.g.dart index 1fdebab66..7425d24d4 100644 --- a/lib/database/powersync/database.g.dart +++ b/lib/database/powersync/database.g.dart @@ -2418,8 +2418,155 @@ class $ExerciseImageTableTable extends ExerciseImageTable 'CHECK ("is_main" IN (0, 1))', ), ); + static const VerificationMeta _isAiGeneratedMeta = const VerificationMeta( + 'isAiGenerated', + ); @override - List get $columns => [id, uuid, exerciseId, image, isMain]; + late final GeneratedColumn isAiGenerated = GeneratedColumn( + 'is_ai_generated', + aliasedName, + false, + type: DriftSqlType.bool, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_ai_generated" IN (0, 1))', + ), + ); + @override + late final GeneratedColumnWithTypeConverter style = + GeneratedColumn( + 'style', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ).withConverter($ExerciseImageTableTable.$converterstyle); + static const VerificationMeta _widthMeta = const VerificationMeta('width'); + @override + late final GeneratedColumn width = GeneratedColumn( + 'width', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _heightMeta = const VerificationMeta('height'); + @override + late final GeneratedColumn height = GeneratedColumn( + 'height', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + ); + static const VerificationMeta _createdMeta = const VerificationMeta( + 'created', + ); + @override + late final GeneratedColumn created = GeneratedColumn( + 'created', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); + static const VerificationMeta _lastUpdateMeta = const VerificationMeta( + 'lastUpdate', + ); + @override + late final GeneratedColumn lastUpdate = GeneratedColumn( + 'last_update', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); + static const VerificationMeta _licenseIdMeta = const VerificationMeta( + 'licenseId', + ); + @override + late final GeneratedColumn licenseId = GeneratedColumn( + 'license_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + ); + static const VerificationMeta _licenseTitleMeta = const VerificationMeta( + 'licenseTitle', + ); + @override + late final GeneratedColumn licenseTitle = GeneratedColumn( + 'license_title', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + static const VerificationMeta _licenseObjectUrlMeta = const VerificationMeta( + 'licenseObjectUrl', + ); + @override + late final GeneratedColumn licenseObjectUrl = GeneratedColumn( + 'license_object_url', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + static const VerificationMeta _licenseAuthorMeta = const VerificationMeta( + 'licenseAuthor', + ); + @override + late final GeneratedColumn licenseAuthor = GeneratedColumn( + 'license_author', + aliasedName, + true, + type: DriftSqlType.string, + requiredDuringInsert: false, + ); + static const VerificationMeta _licenseAuthorUrlMeta = const VerificationMeta( + 'licenseAuthorUrl', + ); + @override + late final GeneratedColumn licenseAuthorUrl = GeneratedColumn( + 'license_author_url', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + static const VerificationMeta _licenseDerivativeSourceUrlMeta = const VerificationMeta( + 'licenseDerivativeSourceUrl', + ); + @override + late final GeneratedColumn licenseDerivativeSourceUrl = GeneratedColumn( + 'license_derivative_source_url', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + @override + List get $columns => [ + id, + uuid, + exerciseId, + image, + isMain, + isAiGenerated, + style, + width, + height, + created, + lastUpdate, + licenseId, + licenseTitle, + licenseObjectUrl, + licenseAuthor, + licenseAuthorUrl, + licenseDerivativeSourceUrl, + ]; @override String get aliasedName => _alias ?? actualTableName; @override @@ -2469,6 +2616,106 @@ class $ExerciseImageTableTable extends ExerciseImageTable } else if (isInserting) { context.missing(_isMainMeta); } + if (data.containsKey('is_ai_generated')) { + context.handle( + _isAiGeneratedMeta, + isAiGenerated.isAcceptableOrUnknown( + data['is_ai_generated']!, + _isAiGeneratedMeta, + ), + ); + } else if (isInserting) { + context.missing(_isAiGeneratedMeta); + } + if (data.containsKey('width')) { + context.handle( + _widthMeta, + width.isAcceptableOrUnknown(data['width']!, _widthMeta), + ); + } + if (data.containsKey('height')) { + context.handle( + _heightMeta, + height.isAcceptableOrUnknown(data['height']!, _heightMeta), + ); + } + if (data.containsKey('created')) { + context.handle( + _createdMeta, + created.isAcceptableOrUnknown(data['created']!, _createdMeta), + ); + } else if (isInserting) { + context.missing(_createdMeta); + } + if (data.containsKey('last_update')) { + context.handle( + _lastUpdateMeta, + lastUpdate.isAcceptableOrUnknown(data['last_update']!, _lastUpdateMeta), + ); + } else if (isInserting) { + context.missing(_lastUpdateMeta); + } + if (data.containsKey('license_id')) { + context.handle( + _licenseIdMeta, + licenseId.isAcceptableOrUnknown(data['license_id']!, _licenseIdMeta), + ); + } else if (isInserting) { + context.missing(_licenseIdMeta); + } + if (data.containsKey('license_title')) { + context.handle( + _licenseTitleMeta, + licenseTitle.isAcceptableOrUnknown( + data['license_title']!, + _licenseTitleMeta, + ), + ); + } else if (isInserting) { + context.missing(_licenseTitleMeta); + } + if (data.containsKey('license_object_url')) { + context.handle( + _licenseObjectUrlMeta, + licenseObjectUrl.isAcceptableOrUnknown( + data['license_object_url']!, + _licenseObjectUrlMeta, + ), + ); + } else if (isInserting) { + context.missing(_licenseObjectUrlMeta); + } + if (data.containsKey('license_author')) { + context.handle( + _licenseAuthorMeta, + licenseAuthor.isAcceptableOrUnknown( + data['license_author']!, + _licenseAuthorMeta, + ), + ); + } + if (data.containsKey('license_author_url')) { + context.handle( + _licenseAuthorUrlMeta, + licenseAuthorUrl.isAcceptableOrUnknown( + data['license_author_url']!, + _licenseAuthorUrlMeta, + ), + ); + } else if (isInserting) { + context.missing(_licenseAuthorUrlMeta); + } + if (data.containsKey('license_derivative_source_url')) { + context.handle( + _licenseDerivativeSourceUrlMeta, + licenseDerivativeSourceUrl.isAcceptableOrUnknown( + data['license_derivative_source_url']!, + _licenseDerivativeSourceUrlMeta, + ), + ); + } else if (isInserting) { + context.missing(_licenseDerivativeSourceUrlMeta); + } return context; } @@ -2498,6 +2745,56 @@ class $ExerciseImageTableTable extends ExerciseImageTable DriftSqlType.bool, data['${effectivePrefix}is_main'], )!, + isAiGenerated: attachedDatabase.typeMapping.read( + DriftSqlType.bool, + data['${effectivePrefix}is_ai_generated'], + )!, + style: $ExerciseImageTableTable.$converterstyle.fromSql( + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}style'], + )!, + ), + width: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}width'], + ), + height: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}height'], + ), + created: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}created'], + )!, + lastUpdate: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}last_update'], + )!, + licenseId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}license_id'], + )!, + licenseTitle: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_title'], + )!, + licenseObjectUrl: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_object_url'], + )!, + licenseAuthor: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_author'], + ), + licenseAuthorUrl: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_author_url'], + )!, + licenseDerivativeSourceUrl: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_derivative_source_url'], + )!, ); } @@ -2505,6 +2802,9 @@ class $ExerciseImageTableTable extends ExerciseImageTable $ExerciseImageTableTable createAlias(String alias) { return $ExerciseImageTableTable(attachedDatabase, alias); } + + static TypeConverter $converterstyle = + const ExerciseImageStyleConverter(); } class ExerciseImageTableCompanion extends UpdateCompanion { @@ -2513,6 +2813,18 @@ class ExerciseImageTableCompanion extends UpdateCompanion { final Value exerciseId; final Value image; final Value isMain; + final Value isAiGenerated; + final Value style; + final Value width; + final Value height; + final Value created; + final Value lastUpdate; + final Value licenseId; + final Value licenseTitle; + final Value licenseObjectUrl; + final Value licenseAuthor; + final Value licenseAuthorUrl; + final Value licenseDerivativeSourceUrl; final Value rowid; const ExerciseImageTableCompanion({ this.id = const Value.absent(), @@ -2520,6 +2832,18 @@ class ExerciseImageTableCompanion extends UpdateCompanion { this.exerciseId = const Value.absent(), this.image = const Value.absent(), this.isMain = const Value.absent(), + this.isAiGenerated = const Value.absent(), + this.style = const Value.absent(), + this.width = const Value.absent(), + this.height = const Value.absent(), + this.created = const Value.absent(), + this.lastUpdate = const Value.absent(), + this.licenseId = const Value.absent(), + this.licenseTitle = const Value.absent(), + this.licenseObjectUrl = const Value.absent(), + this.licenseAuthor = const Value.absent(), + this.licenseAuthorUrl = const Value.absent(), + this.licenseDerivativeSourceUrl = const Value.absent(), this.rowid = const Value.absent(), }); ExerciseImageTableCompanion.insert({ @@ -2528,18 +2852,51 @@ class ExerciseImageTableCompanion extends UpdateCompanion { required int exerciseId, required String image, required bool isMain, + required bool isAiGenerated, + required ExerciseImageStyle style, + this.width = const Value.absent(), + this.height = const Value.absent(), + required DateTime created, + required DateTime lastUpdate, + required int licenseId, + required String licenseTitle, + required String licenseObjectUrl, + this.licenseAuthor = const Value.absent(), + required String licenseAuthorUrl, + required String licenseDerivativeSourceUrl, this.rowid = const Value.absent(), }) : id = Value(id), uuid = Value(uuid), exerciseId = Value(exerciseId), image = Value(image), - isMain = Value(isMain); + isMain = Value(isMain), + isAiGenerated = Value(isAiGenerated), + style = Value(style), + created = Value(created), + lastUpdate = Value(lastUpdate), + licenseId = Value(licenseId), + licenseTitle = Value(licenseTitle), + licenseObjectUrl = Value(licenseObjectUrl), + licenseAuthorUrl = Value(licenseAuthorUrl), + licenseDerivativeSourceUrl = Value(licenseDerivativeSourceUrl); static Insertable custom({ Expression? id, Expression? uuid, Expression? exerciseId, Expression? image, Expression? isMain, + Expression? isAiGenerated, + Expression? style, + Expression? width, + Expression? height, + Expression? created, + Expression? lastUpdate, + Expression? licenseId, + Expression? licenseTitle, + Expression? licenseObjectUrl, + Expression? licenseAuthor, + Expression? licenseAuthorUrl, + Expression? licenseDerivativeSourceUrl, Expression? rowid, }) { return RawValuesInsertable({ @@ -2548,6 +2905,19 @@ class ExerciseImageTableCompanion extends UpdateCompanion { if (exerciseId != null) 'exercise_id': exerciseId, if (image != null) 'image': image, if (isMain != null) 'is_main': isMain, + if (isAiGenerated != null) 'is_ai_generated': isAiGenerated, + if (style != null) 'style': style, + if (width != null) 'width': width, + if (height != null) 'height': height, + if (created != null) 'created': created, + if (lastUpdate != null) 'last_update': lastUpdate, + if (licenseId != null) 'license_id': licenseId, + if (licenseTitle != null) 'license_title': licenseTitle, + if (licenseObjectUrl != null) 'license_object_url': licenseObjectUrl, + if (licenseAuthor != null) 'license_author': licenseAuthor, + if (licenseAuthorUrl != null) 'license_author_url': licenseAuthorUrl, + if (licenseDerivativeSourceUrl != null) + 'license_derivative_source_url': licenseDerivativeSourceUrl, if (rowid != null) 'rowid': rowid, }); } @@ -2558,6 +2928,18 @@ class ExerciseImageTableCompanion extends UpdateCompanion { Value? exerciseId, Value? image, Value? isMain, + Value? isAiGenerated, + Value? style, + Value? width, + Value? height, + Value? created, + Value? lastUpdate, + Value? licenseId, + Value? licenseTitle, + Value? licenseObjectUrl, + Value? licenseAuthor, + Value? licenseAuthorUrl, + Value? licenseDerivativeSourceUrl, Value? rowid, }) { return ExerciseImageTableCompanion( @@ -2566,6 +2948,18 @@ class ExerciseImageTableCompanion extends UpdateCompanion { exerciseId: exerciseId ?? this.exerciseId, image: image ?? this.image, isMain: isMain ?? this.isMain, + isAiGenerated: isAiGenerated ?? this.isAiGenerated, + style: style ?? this.style, + width: width ?? this.width, + height: height ?? this.height, + created: created ?? this.created, + lastUpdate: lastUpdate ?? this.lastUpdate, + licenseId: licenseId ?? this.licenseId, + licenseTitle: licenseTitle ?? this.licenseTitle, + licenseObjectUrl: licenseObjectUrl ?? this.licenseObjectUrl, + licenseAuthor: licenseAuthor ?? this.licenseAuthor, + licenseAuthorUrl: licenseAuthorUrl ?? this.licenseAuthorUrl, + licenseDerivativeSourceUrl: licenseDerivativeSourceUrl ?? this.licenseDerivativeSourceUrl, rowid: rowid ?? this.rowid, ); } @@ -2588,6 +2982,46 @@ class ExerciseImageTableCompanion extends UpdateCompanion { if (isMain.present) { map['is_main'] = Variable(isMain.value); } + if (isAiGenerated.present) { + map['is_ai_generated'] = Variable(isAiGenerated.value); + } + if (style.present) { + map['style'] = Variable( + $ExerciseImageTableTable.$converterstyle.toSql(style.value), + ); + } + if (width.present) { + map['width'] = Variable(width.value); + } + if (height.present) { + map['height'] = Variable(height.value); + } + if (created.present) { + map['created'] = Variable(created.value); + } + if (lastUpdate.present) { + map['last_update'] = Variable(lastUpdate.value); + } + if (licenseId.present) { + map['license_id'] = Variable(licenseId.value); + } + if (licenseTitle.present) { + map['license_title'] = Variable(licenseTitle.value); + } + if (licenseObjectUrl.present) { + map['license_object_url'] = Variable(licenseObjectUrl.value); + } + if (licenseAuthor.present) { + map['license_author'] = Variable(licenseAuthor.value); + } + if (licenseAuthorUrl.present) { + map['license_author_url'] = Variable(licenseAuthorUrl.value); + } + if (licenseDerivativeSourceUrl.present) { + map['license_derivative_source_url'] = Variable( + licenseDerivativeSourceUrl.value, + ); + } if (rowid.present) { map['rowid'] = Variable(rowid.value); } @@ -2602,6 +3036,18 @@ class ExerciseImageTableCompanion extends UpdateCompanion { ..write('exerciseId: $exerciseId, ') ..write('image: $image, ') ..write('isMain: $isMain, ') + ..write('isAiGenerated: $isAiGenerated, ') + ..write('style: $style, ') + ..write('width: $width, ') + ..write('height: $height, ') + ..write('created: $created, ') + ..write('lastUpdate: $lastUpdate, ') + ..write('licenseId: $licenseId, ') + ..write('licenseTitle: $licenseTitle, ') + ..write('licenseObjectUrl: $licenseObjectUrl, ') + ..write('licenseAuthor: $licenseAuthor, ') + ..write('licenseAuthorUrl: $licenseAuthorUrl, ') + ..write('licenseDerivativeSourceUrl: $licenseDerivativeSourceUrl, ') ..write('rowid: $rowid') ..write(')')) .toString(); @@ -2646,6 +3092,18 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable 'REFERENCES exercises_exercise (id)', ), ); + static const VerificationMeta _isMainMeta = const VerificationMeta('isMain'); + @override + late final GeneratedColumn isMain = GeneratedColumn( + 'is_main', + aliasedName, + false, + type: DriftSqlType.bool, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("is_main" IN (0, 1))', + ), + ); static const VerificationMeta _urlMeta = const VerificationMeta('url'); @override late final GeneratedColumn url = GeneratedColumn( @@ -2713,6 +3171,28 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable type: DriftSqlType.string, requiredDuringInsert: true, ); + static const VerificationMeta _createdMeta = const VerificationMeta( + 'created', + ); + @override + late final GeneratedColumn created = GeneratedColumn( + 'created', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); + static const VerificationMeta _lastUpdateMeta = const VerificationMeta( + 'lastUpdate', + ); + @override + late final GeneratedColumn lastUpdate = GeneratedColumn( + 'last_update', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); static const VerificationMeta _licenseIdMeta = const VerificationMeta( 'licenseId', ); @@ -2724,6 +3204,28 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable type: DriftSqlType.int, requiredDuringInsert: true, ); + static const VerificationMeta _licenseTitleMeta = const VerificationMeta( + 'licenseTitle', + ); + @override + late final GeneratedColumn licenseTitle = GeneratedColumn( + 'license_title', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + static const VerificationMeta _licenseObjectUrlMeta = const VerificationMeta( + 'licenseObjectUrl', + ); + @override + late final GeneratedColumn licenseObjectUrl = GeneratedColumn( + 'license_object_url', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); static const VerificationMeta _licenseAuthorMeta = const VerificationMeta( 'licenseAuthor', ); @@ -2731,6 +3233,28 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable late final GeneratedColumn licenseAuthor = GeneratedColumn( 'license_author', aliasedName, + true, + type: DriftSqlType.string, + requiredDuringInsert: false, + ); + static const VerificationMeta _licenseAuthorUrlMeta = const VerificationMeta( + 'licenseAuthorUrl', + ); + @override + late final GeneratedColumn licenseAuthorUrl = GeneratedColumn( + 'license_author_url', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); + static const VerificationMeta _licenseDerivativeSourceUrlMeta = const VerificationMeta( + 'licenseDerivativeSourceUrl', + ); + @override + late final GeneratedColumn licenseDerivativeSourceUrl = GeneratedColumn( + 'license_derivative_source_url', + aliasedName, false, type: DriftSqlType.string, requiredDuringInsert: true, @@ -2740,6 +3264,7 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable id, uuid, exerciseId, + isMain, url, size, duration, @@ -2747,8 +3272,14 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable height, codec, codecLong, + created, + lastUpdate, licenseId, + licenseTitle, + licenseObjectUrl, licenseAuthor, + licenseAuthorUrl, + licenseDerivativeSourceUrl, ]; @override String get aliasedName => _alias ?? actualTableName; @@ -2783,6 +3314,14 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable } else if (isInserting) { context.missing(_exerciseIdMeta); } + if (data.containsKey('is_main')) { + context.handle( + _isMainMeta, + isMain.isAcceptableOrUnknown(data['is_main']!, _isMainMeta), + ); + } else if (isInserting) { + context.missing(_isMainMeta); + } if (data.containsKey('url')) { context.handle( _urlMeta, @@ -2839,6 +3378,22 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable } else if (isInserting) { context.missing(_codecLongMeta); } + if (data.containsKey('created')) { + context.handle( + _createdMeta, + created.isAcceptableOrUnknown(data['created']!, _createdMeta), + ); + } else if (isInserting) { + context.missing(_createdMeta); + } + if (data.containsKey('last_update')) { + context.handle( + _lastUpdateMeta, + lastUpdate.isAcceptableOrUnknown(data['last_update']!, _lastUpdateMeta), + ); + } else if (isInserting) { + context.missing(_lastUpdateMeta); + } if (data.containsKey('license_id')) { context.handle( _licenseIdMeta, @@ -2847,6 +3402,28 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable } else if (isInserting) { context.missing(_licenseIdMeta); } + if (data.containsKey('license_title')) { + context.handle( + _licenseTitleMeta, + licenseTitle.isAcceptableOrUnknown( + data['license_title']!, + _licenseTitleMeta, + ), + ); + } else if (isInserting) { + context.missing(_licenseTitleMeta); + } + if (data.containsKey('license_object_url')) { + context.handle( + _licenseObjectUrlMeta, + licenseObjectUrl.isAcceptableOrUnknown( + data['license_object_url']!, + _licenseObjectUrlMeta, + ), + ); + } else if (isInserting) { + context.missing(_licenseObjectUrlMeta); + } if (data.containsKey('license_author')) { context.handle( _licenseAuthorMeta, @@ -2855,8 +3432,28 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable _licenseAuthorMeta, ), ); + } + if (data.containsKey('license_author_url')) { + context.handle( + _licenseAuthorUrlMeta, + licenseAuthorUrl.isAcceptableOrUnknown( + data['license_author_url']!, + _licenseAuthorUrlMeta, + ), + ); } else if (isInserting) { - context.missing(_licenseAuthorMeta); + context.missing(_licenseAuthorUrlMeta); + } + if (data.containsKey('license_derivative_source_url')) { + context.handle( + _licenseDerivativeSourceUrlMeta, + licenseDerivativeSourceUrl.isAcceptableOrUnknown( + data['license_derivative_source_url']!, + _licenseDerivativeSourceUrlMeta, + ), + ); + } else if (isInserting) { + context.missing(_licenseDerivativeSourceUrlMeta); } return context; } @@ -2879,14 +3476,18 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable DriftSqlType.int, data['${effectivePrefix}exercise_id'], )!, - size: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}size'], + isMain: attachedDatabase.typeMapping.read( + DriftSqlType.bool, + data['${effectivePrefix}is_main'], )!, url: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}url'], )!, + size: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}size'], + )!, duration: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}duration'], @@ -2907,13 +3508,37 @@ class $ExerciseVideoTableTable extends ExerciseVideoTable DriftSqlType.string, data['${effectivePrefix}codec_long'], )!, + created: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}created'], + )!, + lastUpdate: attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}last_update'], + )!, licenseId: attachedDatabase.typeMapping.read( DriftSqlType.int, data['${effectivePrefix}license_id'], )!, + licenseTitle: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_title'], + )!, + licenseObjectUrl: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_object_url'], + )!, licenseAuthor: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}license_author'], + ), + licenseAuthorUrl: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_author_url'], + )!, + licenseDerivativeSourceUrl: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}license_derivative_source_url'], )!, ); } @@ -2928,6 +3553,7 @@ class ExerciseVideoTableCompanion extends UpdateCompanion