Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('routines', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained();
|
||||
$table->string('name');
|
||||
$table->string('slug')->index();
|
||||
$table->text('description')->nullable();
|
||||
$table->boolean('is_public')->default(false);
|
||||
$table->unsignedInteger('estimated_minutes')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('routines');
|
||||
}
|
||||
};
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// Pivot enrichi : un exercice positionné dans une routine, avec ses paramètres d'entraînement.
|
||||
Schema::create('routine_exercises', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('routine_id')->constrained();
|
||||
$table->foreignId('exercise_id')->constrained();
|
||||
$table->unsignedInteger('position');
|
||||
$table->unsignedInteger('sets');
|
||||
$table->string('target_reps'); // ex "8-12"
|
||||
$table->unsignedInteger('rest_seconds')->nullable();
|
||||
$table->string('tempo')->nullable();
|
||||
$table->decimal('target_weight', 8, 2)->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('routine_exercises');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user