に移行を使用して、データベースの主キーと自動インクリメントを削除し、私は新しい移行が主キー索引をドロップするように作っても自動インクリメントフィールドを削除します。どのように私はこれを達成することができます。私は、主キーと自動インクリメントフィールドを持つテーブルがあるlaravel
私はそれは[Illuminate\Database\QueryException]
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'message _id' (SQL: alter table tbl_'message_read_state' add 'message_id' int unsigned not null)
いただきました間違ったように、コマンドに私にエラーを与えた
public function up()
{
Schema::table('tbl_message_read_state', function (Blueprint $table) {
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('tbl_message_read_state', function (Blueprint $table) {
$table->dropPrimary('message_id');
$table->unsignedInteger('message_id');
});
}
として新しい移行を作成?????
何職人コマンドになりますか? – JohnB