laravel migrácie zmeniť názov stĺpca
Schema::table('users', function (Blueprint $table) {
$table->renameColumn('from', 'to');
});
zmena migrácie Laravelu názov stĺpca
Schema::table('users', function (Blueprint $table) {
$table->renameColumn('from', 'to');
});
laravel migrácie celé číslo
$table->bigInteger('votes');
laravel vrátenie poslednej migrácie
php artisan migrate:rollback --step=1
zmena migrácie Laravelu typ stĺpca
public function up()
{
Schema::table('sometable', function (Blueprint $table) {
$table->text('text')->change();
});
}
migrácia požadované pole laravel
$table->string('foo')->nullable(false)->change();
laravel vrátenie poslednej migrácie
php artisan migrate:rollback --step=1
laravel vytvoriť migrácie
php artisan make:migration add_votes_to_users_table --table=users
php artisan make:migration create_users_table --create=users
laravel vytvoriť migráciu
php artisan make:migration add_votes_to_users_table --table=users
php artisan make:migration create_users_table --create=users