fix: edit exerice template

This commit is contained in:
2025-09-13 17:14:13 +03:30
parent a134ed69ba
commit 35fb0cd417
2 changed files with 1 additions and 4 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
class BreathingTemplate extends Model class BreathingTemplate extends Model
{ {
protected $fillable = ['user_id', 'name', 'inhale', 'exhale', 'repeat']; protected $fillable = ['user_id', 'name', 'inhale', 'exhale', 'breath_hold' , 'duration'];
public function user() public function user()
{ {
@@ -11,14 +11,11 @@ public function run(): void
{ {
BreathingTemplate::query()->delete(); BreathingTemplate::query()->delete();
// تشخیص نوع دیتابیس
$driver = DB::getDriverName(); $driver = DB::getDriverName();
if ($driver === 'mysql') { if ($driver === 'mysql') {
// ریست Auto Increment در MySQL
DB::statement('ALTER TABLE breathing_templates AUTO_INCREMENT = 1'); DB::statement('ALTER TABLE breathing_templates AUTO_INCREMENT = 1');
} elseif ($driver === 'pgsql') { } elseif ($driver === 'pgsql') {
// ریست Sequence در PostgreSQL
DB::statement('ALTER SEQUENCE breathing_templates_id_seq RESTART WITH 1'); DB::statement('ALTER SEQUENCE breathing_templates_id_seq RESTART WITH 1');
} }
$templates = [ $templates = [