Add company_id column to media tables
This commit is contained in:
44
database/migrations/2021_05_17_000000_core_v2114.php
Normal file
44
database/migrations/2021_05_17_000000_core_v2114.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CoreV2114 extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('media', function (Blueprint $table) {
|
||||
$table->unsignedInteger('company_id')->after('id');
|
||||
|
||||
$table->index('company_id');
|
||||
});
|
||||
|
||||
Schema::table('mediables', function (Blueprint $table) {
|
||||
$table->unsignedInteger('company_id')->after('media_id');
|
||||
|
||||
$table->index('company_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('media', function (Blueprint $table) {
|
||||
$table->dropColumn('company_id');
|
||||
});
|
||||
|
||||
Schema::table('mediables', function (Blueprint $table) {
|
||||
$table->dropColumn('company_id');
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user