Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning config table #1491

Merged
merged 12 commits into from
Sep 5, 2022
45 changes: 45 additions & 0 deletions database/migrations/2022_08_27_110209_drop_admin_user_config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

use App\Models\Configs;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class DropAdminUserConfig extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::table('configs')->whereIn('key', ['username', 'password'])->delete();
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
defined('STRING_REQ') or define('STRING_REQ', 'string_required');

Configs::insert(
[
'key' => 'username',
'value' => '',
'cat' => 'Admin',
'type_range' => STRING_REQ,
'confidentiality' => '4',
],
[
'key' => 'password',
'value' => '',
'cat' => 'Admin',
'type_range' => STRING_REQ,
'confidentiality' => '4',
]
);
}
}
2 changes: 1 addition & 1 deletion public/Lychee-front