Added location_id to assets table to denorm

This commit is contained in:
snipe 2017-10-27 20:35:34 -07:00
parent 7e0c33d535
commit e8b4bdf6f4

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class DenormAssetLocations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Add a new effective location ID to flatten out the assets queries
Schema::table('assets', function (Blueprint $table) {
$table->integer('location_id')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function (Blueprint $table) {
$table->dropColumn('location_id');
});
}
}