An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
rename postgres to standalonepostgres
Andras Bacsai20e1cd6d6b77
diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.phpindex d9f2c88469..2ff91ce2fd 100644--- a/app/Actions/Database/StartPostgresql.php+++ b/app/Actions/Database/StartPostgresql.php@@ -5,11 +5,11 @@ namespace App\Actions\Database;use App\Models\Server;use App\Models\StandaloneDocker;use App\Models\Team;-use App\Models\Postgresql;+use App\Models\StandalonePostgres;class StartPostgresql{- public function __invoke(Server $server, Postgresql $database)+ public function __invoke(Server $server, StandalonePostgres $database){$activity = remote_process(["echo 'Creating required Docker networks...'",diff --git a/app/Models/Environment.php b/app/Models/Environment.phpindex e7139a5bdb..ca47fd2929 100644--- a/app/Models/Environment.php+++ b/app/Models/Environment.php@@ -33,7 +33,7 @@ class Environment extends Model}public function postgresqls(){- return $this->hasMany(Postgresql::class);+ return $this->hasMany(StandalonePostgres::class);}public function services(){diff --git a/app/Models/Project.php b/app/Models/Project.phpindex 791b8a7cc7..129df30723 100644--- a/app/Models/Project.php+++ b/app/Models/Project.php@@ -48,6 +48,6 @@ class Project extends BaseModel}public function postgresqls(){- return $this->hasManyThrough(Postgresql::class, Environment::class);+ return $this->hasManyThrough(StandalonePostgres::class, Environment::class);}}\ No newline at end of filediff --git a/app/Models/StandaloneDocker.php b/app/Models/StandaloneDocker.phpindex e5f1cf3f3f..c14bb855da 100644--- a/app/Models/StandaloneDocker.php+++ b/app/Models/StandaloneDocker.php@@ -15,7 +15,7 @@ class StandaloneDocker extends BaseModel}public function postgresqls(){- return $this->morphMany(Postgresql::class, 'destination');+ return $this->morphMany(StandalonePostgres::class, 'destination');}public function server(){diff --git a/app/Models/Postgresql.php b/app/Models/StandalonePostgres.phpsimilarity index 91%rename from app/Models/Postgresql.phprename to app/Models/StandalonePostgres.phpindex 10e536685f..df4295512f 100644--- a/app/Models/Postgresql.php+++ b/app/Models/StandalonePostgres.php@@ -4,7 +4,7 @@ namespace App\Models;use Illuminate\Database\Eloquent\Factories\HasFactory;-class Postgresql extends BaseModel+class StandalonePostgres extends BaseModel{use HasFactory;protected $guarded = [];diff --git a/database/migrations/2023_08_07_142950_create_postgresqls_table.php b/database/migrations/2023_08_07_142950_create_standalone_postgres_table.phpsimilarity index 89%rename from database/migrations/2023_08_07_142950_create_postgresqls_table.phprename to database/migrations/2023_08_07_142950_create_standalone_postgres_table.phpindex 8d126ce3e6..43215a184a 100644--- a/database/migrations/2023_08_07_142950_create_postgresqls_table.php+++ b/database/migrations/2023_08_07_142950_create_standalone_postgres_table.php@@ -11,7 +11,7 @@ return new class extends Migration*/public function up(): void{- Schema::create('postgresqls', function (Blueprint $table) {+ Schema::create('standalone_postgres', function (Blueprint $table) {$table->id();$table->string('uuid')->unique();$table->string('name');@@ -37,6 +37,6 @@ return new class extends Migration*/public function down(): void{- Schema::dropIfExists('postgresqls');+ Schema::dropIfExists('standalone_postgres');}};\ No newline at end of filediff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.phpindex 7fa45e6b86..2bff4f36f2 100644--- a/database/seeders/DatabaseSeeder.php+++ b/database/seeders/DatabaseSeeder.php@@ -32,7 +32,7 @@ class DatabaseSeeder extends SeederEnvironmentVariableSeeder::class,LocalPersistentVolumeSeeder::class,S3StorageSeeder::class,- PostgresqlSeeder::class,+ StandalonePostgresSeeder::class,]);}}\ No newline at end of filediff --git a/database/seeders/PostgresqlSeeder.php b/database/seeders/StandalonePostgresSeeder.phpsimilarity index 82%rename from database/seeders/PostgresqlSeeder.phprename to database/seeders/StandalonePostgresSeeder.phpindex 2568feb106..c045d7358e 100644--- a/database/seeders/PostgresqlSeeder.php+++ b/database/seeders/StandalonePostgresSeeder.php@@ -4,17 +4,17 @@ namespace Database\Seeders;use Illuminate\Database\Console\Seeds\WithoutModelEvents;use Illuminate\Database\Seeder;-use App\Models\Postgresql;+use App\Models\StandalonePostgres;use App\Models\StandaloneDocker;-class PostgresqlSeeder extends Seeder+class StandalonePostgresSeeder extends Seeder{/*** Run the database seeds.*/public function run(): void{- Postgresql::create([+ StandalonePostgres::create(['name' => 'Local PostgreSQL','description' => 'Local PostgreSQL for testing','postgres_password' => 'postgres',diff --git a/resources/views/livewire/project/new/select.blade.php b/resources/views/livewire/project/new/select.blade.phpindex e6b2511e5e..042ff38d97 100644--- a/resources/views/livewire/project/new/select.blade.php+++ b/resources/views/livewire/project/new/select.blade.php@@ -1,6 +1,6 @@<div x-data x-init="$wire.load_servers"><h1>New Resource</h1>- <div class="pb-4 ">Deploy any Git repository from different sources.</div>+ <div class="pb-4 ">Deploy resources, like Applications, Databases, Services...</div><div class="flex flex-col pt-10">@if ($current_step === 'type')<ul class="pb-10 steps">@@ -8,6 +8,7 @@<li class="step">Select a Server</li><li class="step">Select a Destination</li></ul>+ <h3 class="pb-4">Applications</h3><div class="flex flex-col justify-center gap-2 text-left xl:flex-row"><div class="gap-2 py-4 cursor-pointer group hover:bg-coollabs bg-coolgray-200"wire:click="set_type('public')">@@ -40,6 +41,20 @@</div></div></div>+ <h3 class="py-4">Databases</h3>+ <div class="flex flex-col justify-center gap-2 text-left xl:flex-row">+ <div class="gap-2 py-4 cursor-pointer group hover:bg-coollabs bg-coolgray-200"+ wire:click="set_type('postgresql')">+ <div class="flex flex-col mx-6">+ <div class="group-hover:text-white">+ PostgreSQL+ </div>+ <div class="text-xs group-hover:text-white">+ The most loved relational database in the world.</div>+ </div>+ </div>++ </div>@endif@if ($current_step === 'servers')<ul class="pb-10 steps">diff --git a/resources/views/project/database/configuration.blade.php b/resources/views/project/database/configuration.blade.phpindex ab75e76164..c01ffe2488 100644--- a/resources/views/project/database/configuration.blade.php+++ b/resources/views/project/database/configuration.blade.php@@ -38,7 +38,7 @@</div><div class="w-full pl-8"><div x-cloak x-show="activeTab === 'general'" class="h-full">- @if ($database->getMorphClass() === 'App\Models\Postgresql')+ @if ($database->type() === 'postgresql')<livewire:project.database.postgresql.general :database="$database" />@endif</div>