laravel cudzí kľúč
Schema::table('posts', function (Blueprint $table) {
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
});
OR
Schema::table('posts', function (Blueprint $table) {
$table->foreignId('user_id')->constrained();
});
php remeselník vykonať migráciu
php artisan make:migration create_users_table
pridať stĺpec v laravel migrácie
php artisan make:migration add_paid_to_users_table --table=users
vytvorenie migrácie Laravelu
php artisan make:migration create_users_table
vrátenie migrácie remeselníka
php artisan migrate:rollback
laravel vytvoriť novú migráciu
php artisan make:migration create_flights_table