1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

prefix all db field with db_

This commit is contained in:
Benjamin Beganović 2020-12-08 14:21:00 +01:00
parent 3505c89e2d
commit 3ffb600117
5 changed files with 15 additions and 15 deletions

View File

@ -34,9 +34,9 @@ class CheckDatabaseRequest extends Request
public function rules()
{
return [
'host' => ['required'],
'database' => ['required'],
'username' => ['required'],
'db_host' => ['required'],
'db_database' => ['required'],
'db_username' => ['required'],
];
}
}

View File

@ -31,8 +31,8 @@ class StoreSetupRequest extends Request
/*System*/
'url' => 'required',
/*Database*/
'host' => 'required',
'database' => 'required',
'db_host' => 'required',
'db_database' => 'required',
'db_username' => 'required',
'db_password' => '',
/*Mail driver*/

View File

@ -161,10 +161,10 @@ class SystemHealth
$result = ['success' => false];
if ($request && $request instanceof CheckDatabaseRequest) {
config(['database.connections.db-ninja-01.host'=> $request->input('host')]);
config(['database.connections.db-ninja-01.database'=> $request->input('database')]);
config(['database.connections.db-ninja-01.username'=> $request->input('username')]);
config(['database.connections.db-ninja-01.password'=> $request->input('password')]);
config(['database.connections.db-ninja-01.host'=> $request->input('db_host')]);
config(['database.connections.db-ninja-01.database'=> $request->input('db_database')]);
config(['database.connections.db-ninja-01.username'=> $request->input('db_username')]);
config(['database.connections.db-ninja-01.password'=> $request->input('db_password')]);
config(['database.default' => 'db-ninja-01']);
DB::purge('db-ninja-01');

View File

@ -24,10 +24,10 @@ class Setup {
handleDatabaseCheck() {
let data = {
host: document.querySelector('input[name="host"]').value,
database: document.querySelector('input[name="database"]').value,
username: document.querySelector('input[name="db_username"]').value,
password: document.querySelector('input[name="db_password"]').value,
db_host: document.querySelector('input[name="db_host"]').value,
db_database: document.querySelector('input[name="db_database"]').value,
db_username: document.querySelector('input[name="db_username"]').value,
db_password: document.querySelector('input[name="db_password"]').value,
};
Axios.post('/setup/check_db', data)

View File

@ -38,7 +38,7 @@ FLUSH PRIVILEGES;
{{ ctrans('texts.host') }}*
</dt>
<dd class="text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input type="text" class="input w-full" name="host" required value="{{ old('host') ?: 'localhost'}}">
<input type="text" class="input w-full" name="db_host" required value="{{ old('host') ?: 'localhost'}}">
</dd>
</div>
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
@ -46,7 +46,7 @@ FLUSH PRIVILEGES;
{{ ctrans('texts.database') }}*
</dt>
<dd class="text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input type="text" class="input w-full" name="database" required value="{{ old('database') ?: 'db-ninja-01'}}">
<input type="text" class="input w-full" name="db_database" required value="{{ old('database') ?: 'db-ninja-01'}}">
</dd>
</div>
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">