mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Update migration back in time
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c12ef19fcc
commit
3dd7c00a0b
|
@ -14,13 +14,14 @@ class CreateCustomFieldCustomFieldset extends Migration {
|
||||||
{
|
{
|
||||||
Schema::create('custom_field_custom_fieldset', function(Blueprint $table)
|
Schema::create('custom_field_custom_fieldset', function(Blueprint $table)
|
||||||
{
|
{
|
||||||
|
$table->bigIncrements('id')->first();
|
||||||
$table->integer('custom_field_id');
|
$table->integer('custom_field_id');
|
||||||
$table->integer('custom_fieldset_id');
|
$table->integer('custom_fieldset_id');
|
||||||
|
|
||||||
$table->integer('order');
|
$table->integer('order');
|
||||||
$table->boolean('required');
|
$table->boolean('required');
|
||||||
$table->engine = 'InnoDB';
|
$table->engine = 'InnoDB';
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,9 +13,14 @@ class AddPrimaryKeyToCustomFieldsPivot extends Migration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Check if the ID primary key already exists, if not, add it
|
||||||
Schema::table('custom_field_custom_fieldset', function (Blueprint $table) {
|
Schema::table('custom_field_custom_fieldset', function (Blueprint $table) {
|
||||||
$table->bigIncrements('id')->first();
|
if (!Schema::hasColumn('custom_field_custom_fieldset', 'id')) {
|
||||||
|
$table->bigIncrements('id')->first();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue