mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-25 07:23:59 +00:00
Merge branch 'dillon/110-period-lock-a' into vapor/development
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class MakeOwnerNullableInKeyValuePairs extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('key_value_pairs', function (Blueprint $table) {
|
||||
$table->string('owner_type')->nullable()->change();
|
||||
$table->unsignedBigInteger('owner_id')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('key_value_pairs', function (Blueprint $table) {
|
||||
$table->string('owner_type')->nullable(false)->change();
|
||||
$table->unsignedBigInteger('owner_id')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\KeyValuePair;
|
||||
|
||||
|
||||
class KeyValuePairSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$data = [
|
||||
[
|
||||
'key' => KVPKey::UI_PAYMENTS_COMPLETE_CURRENCY_ORDERS_IS_LOCKED,
|
||||
'value' => 0,
|
||||
],
|
||||
[
|
||||
'key' => KVPKey::UI_PAYMENTS_OPEN_CURRENCY_ORDERS_IS_LOCKED,
|
||||
'value' => 0,
|
||||
],
|
||||
[
|
||||
'key' => KVPKey::UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED,
|
||||
'value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($data as $item) {
|
||||
KeyValuePair::updateOrCreate(
|
||||
[
|
||||
'owner_type' => null,
|
||||
'owner_id' => null,
|
||||
'key' => $item['key'],
|
||||
],
|
||||
[
|
||||
'value' => $item['value'],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user