add update migrations

pull/1/head
Farid Saravi 5 years ago
parent a8fb037801
commit b5705400a6

@ -1,37 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateModuleUser extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$dbName = config('core.db_name');
Schema::create("$dbName.module_user", function (Blueprint $table) {
$table->unsignedInteger('module_id');
$table->unsignedInteger('user_id');
$table->unique(['module_id', 'user_id']);
$table->index('module_id');
$table->index('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$dbName = config('core.db_name');
Schema::dropIfExists("$dbName.module_user");
}
}

@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class TempUpdateColumns extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$dbName = config('crm.db_name');
Schema::table("$dbName.clients", function (Blueprint $table) {
$table->string('father_name', 255)->nullable();
$table->string('telegram', 255)->nullable();
$table->string('website', 255)->nullable();
$table->text('description')->nullable();
$table->unsignedInteger('client_title_id')->nullable();
$table->foreign('client_title_id')->references('id')->on('client_titles');
$table->dropColumn('client_category_id');
});
Schema::table("$dbName.client_statuses", function (Blueprint $table) {
$table->string('color', 255)->nullable();
$table->string('icon', 255)->nullable();
});
$dbName = config('common.db_name');
Schema::table("$dbName.task_statuses", function (Blueprint $table) {
$table->string('color', 255)->nullable();
$table->string('icon', 255)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}
Loading…
Cancel
Save