Skip to content

Commit 32f92f2

Browse files
[Fix] Use latest versions of db services (#1157)
* latest versions of mariadb * fix * mysql version bump + fixes * postgresql fixes
1 parent c9568a0 commit 32f92f2

28 files changed

Lines changed: 170 additions & 369 deletions

app/Providers/ServiceTypeServiceProvider.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ private function databases(): void
6969
->label('MySQL')
7070
->handler(Mysql::class)
7171
->versions([
72+
'9.7',
7273
'8.4',
73-
'8.0',
7474
])
7575
->configPaths([
7676
[
@@ -90,8 +90,6 @@ private function databases(): void
9090
'16',
9191
'15',
9292
'14',
93-
'13',
94-
'12',
9593
])
9694
->configPaths([
9795
[
@@ -106,11 +104,10 @@ private function databases(): void
106104
->label('MariaDB')
107105
->handler(Mariadb::class)
108106
->versions([
107+
'12.3',
108+
'11.8',
109109
'11.4',
110110
'10.11',
111-
'10.6',
112-
'10.4',
113-
'10.3',
114111
])
115112
->configPaths([
116113
[

app/Services/Database/AbstractDatabase.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use App\Models\BackupFile;
99
use App\Services\AbstractService;
1010
use Closure;
11+
use Illuminate\Contracts\View\View;
1112

1213
abstract class AbstractDatabase extends AbstractService implements Database
1314
{
@@ -56,7 +57,7 @@ function (string $attribute, mixed $value, Closure $fail): void {
5657
public function install(): void
5758
{
5859
$version = str_replace('.', '', $this->service->version);
59-
$command = view($this->getScriptView('install-'.$version));
60+
$command = $this->installScript();
6061
$this->service->server->ssh()
6162
->setLog($this->service->log)
6263
->exec($command, 'install-'.$this->service->name.'-'.$version);
@@ -67,6 +68,13 @@ public function install(): void
6768
app(SyncDatabases::class)->sync($this->service->server);
6869
}
6970

71+
protected function installScript(): View
72+
{
73+
$version = str_replace('.', '', $this->service->version);
74+
75+
return view($this->getScriptView('install-'.$version));
76+
}
77+
7078
public function deletionRules(): array
7179
{
7280
return [

app/Services/Database/Mariadb.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\DTOs\ServiceLog;
66
use App\Services\HasLogs;
7+
use Illuminate\Contracts\View\View;
78

89
class Mariadb extends AbstractDatabase implements HasLogs
910
{
@@ -32,6 +33,13 @@ public function unit(): string
3233
return 'mariadb';
3334
}
3435

36+
protected function installScript(): View
37+
{
38+
return view($this->getScriptView('install'), [
39+
'version' => $this->service->version,
40+
]);
41+
}
42+
3543
public function version(): string
3644
{
3745
$version = $this->service->server->ssh()->exec(

app/Services/Database/Mysql.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\DTOs\ServiceLog;
66
use App\Services\HasLogs;
7+
use Illuminate\Contracts\View\View;
78

89
class Mysql extends AbstractDatabase implements HasLogs
910
{
@@ -33,6 +34,13 @@ public function unit(): string
3334
return 'mysql';
3435
}
3536

37+
protected function installScript(): View
38+
{
39+
return view($this->getScriptView('install'), [
40+
'version' => $this->service->version,
41+
]);
42+
}
43+
3644
public function version(): string
3745
{
3846
$version = $this->service->server->ssh()->exec(

app/Services/Database/Postgresql.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\DTOs\ServiceLog;
66
use App\Services\HasLogs;
7+
use Illuminate\Contracts\View\View;
78

89
class Postgresql extends AbstractDatabase implements HasLogs
910
{
@@ -37,6 +38,13 @@ public function unit(): string
3738
return 'postgresql';
3839
}
3940

41+
protected function installScript(): View
42+
{
43+
return view($this->getScriptView('install'), [
44+
'version' => $this->service->version,
45+
]);
46+
}
47+
4048
public function version(): string
4149
{
4250
$version = $this->service->server->ssh()->exec(

resources/views/ssh/services/database/mariadb/install-103.blade.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

resources/views/ssh/services/database/mariadb/install-104.blade.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

resources/views/ssh/services/database/mariadb/install-106.blade.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

resources/views/ssh/services/database/mariadb/install-114.blade.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

resources/views/ssh/services/database/mariadb/install-1011.blade.php renamed to resources/views/ssh/services/database/mariadb/install.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
1+
wget -O mariadb_repo_setup https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
22

33
chmod +x mariadb_repo_setup
44

55
sudo DEBIAN_FRONTEND=noninteractive ./mariadb_repo_setup \
6-
--mariadb-server-version="mariadb-10.11"
6+
--mariadb-server-version="mariadb-{{ $version }}"
77

88
sudo DEBIAN_FRONTEND=noninteractive apt-get update
99

0 commit comments

Comments
 (0)