I want to migrate my database to another database server in laravel, I use this generator https://github.com/Xethron/migrations-generator to generate my migration file
But after i run command
php artisan migrate
It's showing error:
[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Table 'm_bank' already has a primary key def ined on it. (SQL: alter table "m_bank" add constraint "PK__m_bank__C5B92243C150E9EA" primary key ("bank_code"))
my migration file:
Schema::create('m_bank_channel', function(Blueprint $table)
{
$table->integer('bank_channel_id', true);
$table->char('bank_channel_code', 10)->primary('PK__m_bank_c__D2103413480C791A');
$table->char('bank_code', 10);
$table->char('channel_code', 4);
$table->string('description', 250);
$table->string('created_by', 15);
$table->dateTime('created_date');
$table->string('modified_by', 15);
$table->dateTime('modified_date');
$table->char('is_active', 1);
});
The 'bank_channel_id' should be primary key and the 'bank_channel_code' is foreign key, is it bug of generator to create foreign key?
Or any idea to solve this?