DONE: feature flags by branches
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCawanganFeatureTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Master DB (mysql7) — per-cawangan feature flags.
|
||||
*
|
||||
* Missing row = off. Enable a pilot after migrate:
|
||||
*
|
||||
* INSERT INTO cawangan_feature (kodcaw, feature, enabled, created_at, updated_at)
|
||||
* VALUES ('X0301', 'pembiayaan_online', 1, NOW(), NOW())
|
||||
* ON DUPLICATE KEY UPDATE enabled = 1;
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::connection('mysql7')->hasTable('cawangan_feature')) {
|
||||
Schema::connection('mysql7')->create('cawangan_feature', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('kodcaw', 20);
|
||||
$table->string('feature', 64);
|
||||
$table->tinyInteger('enabled')->default(0);
|
||||
$table->timestamps();
|
||||
$table->unique(['kodcaw', 'feature'], 'uniq_cawangan_feature');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('mysql7')->dropIfExists('cawangan_feature');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user