lasthourcloud/database/seeders/StandalonePostgresqlSeeder.php
Andras Bacsai bd9a1dbaf3 Add port mappings for postgresql
Able to add init scripts fro postgresql
2023-08-08 14:35:01 +02:00

30 lines
792 B
PHP

<?php
namespace Database\Seeders;
use App\Models\StandaloneDocker;
use App\Models\StandalonePostgresql;
use Illuminate\Database\Seeder;
class StandalonePostgresqlSeeder extends Seeder
{
public function run(): void
{
StandalonePostgresql::create([
'name' => 'Local PostgreSQL',
'description' => 'Local PostgreSQL for testing',
'postgres_password' => 'postgres',
'environment_id' => 1,
'destination_id' => 1,
'destination_type' => StandaloneDocker::class,
'init_scripts' => [
[
'index' => 0,
'filename' => 'init_test_db.sql',
'content' => 'CREATE DATABASE test;'
]
]
]);
}
}