feat: ations
This commit is contained in:
@@ -29,6 +29,10 @@ class UserFactory extends Factory
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'avatar_url' => null,
|
||||
'daily_calorie_goal' => 2000,
|
||||
'daily_protein_goal' => 120,
|
||||
'daily_carbs_goal' => 250,
|
||||
'daily_fats_goal' => 70,
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table): void {
|
||||
$table->unsignedInteger('daily_calorie_goal')->default(2000)->after('avatar_url');
|
||||
$table->decimal('daily_protein_goal', 8, 2)->default(120)->after('daily_calorie_goal');
|
||||
$table->decimal('daily_carbs_goal', 8, 2)->default(250)->after('daily_protein_goal');
|
||||
$table->decimal('daily_fats_goal', 8, 2)->default(70)->after('daily_carbs_goal');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table): void {
|
||||
$table->dropColumn([
|
||||
'daily_calorie_goal',
|
||||
'daily_protein_goal',
|
||||
'daily_carbs_goal',
|
||||
'daily_fats_goal',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user