feat: init postgresql database

This commit is contained in:
Andras Bacsai
2023-08-07 18:46:40 +02:00
parent 0a040a0531
commit a020bc872d
38 changed files with 430 additions and 66 deletions

View File

@@ -19,13 +19,11 @@ class ApplicationSeeder extends Seeder
*/
public function run(): void
{
$environment_1 = Environment::find(1);
$standalone_docker_1 = StandaloneDocker::find(1);
$github_public_source = GithubApp::where('name', 'Public GitHub')->first();
Application::create([
'name' => 'coollabsio/coolify-examples:nodejs-fastify',
'description' => 'NodeJS Fastify Example',
'fqdn' => 'http://foo.com',
'repository_project_id' => 603035348,
'git_repository' => 'coollabsio/coolify-examples',
@@ -33,11 +31,11 @@ class ApplicationSeeder extends Seeder
'build_pack' => 'nixpacks',
'ports_exposes' => '3000',
'ports_mappings' => '3000:3000',
'environment_id' => $environment_1->id,
'destination_id' => $standalone_docker_1->id,
'environment_id' => 1,
'destination_id' => 1,
'destination_type' => StandaloneDocker::class,
'source_id' => $github_public_source->id,
'source_type' => GithubApp::class
]);
}
}
}

View File

@@ -32,6 +32,7 @@ class DatabaseSeeder extends Seeder
EnvironmentVariableSeeder::class,
LocalPersistentVolumeSeeder::class,
S3StorageSeeder::class,
PostgresqlSeeder::class,
]);
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\Postgresql;
use App\Models\StandaloneDocker;
class PostgresqlSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Postgresql::create([
'name' => 'Local PostgreSQL',
'description' => 'Local PostgreSQL for testing',
'postgres_password' => 'postgres',
'environment_id' => 1,
'destination_id' => 1,
'destination_type' => StandaloneDocker::class,
]);
}
}