mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Fix migration from integer to string to handle polymorphic migration
This commit is contained in:
parent
3aa7c60765
commit
90af734f6b
|
@ -18,7 +18,7 @@ class CreateActionlogTable extends Migration
|
|||
$table->integer('user_id')->nullable();
|
||||
$table->string('action_type');
|
||||
$table->integer('target_id')->nullable(); // Was checkedout_to
|
||||
$table->integer('target_type')->nullable(); // For polymorphic thingies
|
||||
$table->string('target_type')->nullable(); // For polymorphic thingies
|
||||
$table->integer('location_id')->nullable();
|
||||
$table->text('note')->nullable();
|
||||
$table->text('filename')->nullable();
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class FixFieldtypeForTargetType extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('action_logs', function ($table) {
|
||||
$table->string('target_type')->nullable()->default(null)->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('action_logs', function ($table) {
|
||||
$table->integer('target_type')->nullable()->default(null)->change();
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue