“Indeks migrasi Laravel” Kode Jawaban

Migrasi Laravel Tambahkan kolom unik

Schema::table('tableName', function($table)
{
    $table->string('column-name')->unique(); //notice the parenthesis I added
});
Sore Seal

kolom drop Laravel

// To drop a column, use the dropColumn method on the schema builder.
// Before dropping columns from a SQLite database, you will need to add
// the doctrine/dbal dependency to your composer.json file and run the
// composer update command in your terminal to install the library:

Schema::table('users', function (Blueprint $table) {
    $table->dropColumn('votes');
});
Yingfufu

Indeks migrasi Laravel

$table->index(['account_id', 'created_at']);
Mysterious Moth

Jawaban yang mirip dengan “Indeks migrasi Laravel”

Pertanyaan yang mirip dengan “Indeks migrasi Laravel”

Lebih banyak jawaban terkait untuk “Indeks migrasi Laravel” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya