coolify/database/seeders/StandalonePostgresqlSeeder.php

30 lines
792 B
PHP
Raw Normal View History

2023-08-07 16:46:40 +00:00
<?php
namespace Database\Seeders;
use App\Models\StandaloneDocker;
use App\Models\StandalonePostgresql;
use Illuminate\Database\Seeder;
2023-08-07 16:46:40 +00:00
2023-08-07 20:14:21 +00:00
class StandalonePostgresqlSeeder extends Seeder
2023-08-07 16:46:40 +00:00
{
public function run(): void
{
2023-08-07 20:14:21 +00:00
StandalonePostgresql::create([
2023-08-07 16:46:40 +00:00
'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;'
]
]
2023-08-07 16:46:40 +00:00
]);
}
2023-08-07 20:14:21 +00:00
}