database-host: reverse node relationship

This commit is contained in:
Matthew Penner 2022-12-14 18:53:31 -07:00
parent 0c5416ee27
commit 507a802dec
No known key found for this signature in database
5 changed files with 20 additions and 24 deletions

View file

@ -62,7 +62,7 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase
$server = $this->createServerModel();
$node = Node::factory()->create(['location_id' => $server->location->id]);
DatabaseHost::factory()->create(['node_id' => $node->id]);
DatabaseHost::factory()->create();
config()->set('pterodactyl.client_features.databases.allow_random', false);
@ -97,8 +97,8 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase
$server = $this->createServerModel();
$node = Node::factory()->create(['location_id' => $server->location->id]);
DatabaseHost::factory()->create(['node_id' => $node->id]);
$host = DatabaseHost::factory()->create(['node_id' => $server->node_id]);
DatabaseHost::factory()->create();
$host = DatabaseHost::factory()->create();
$this->managementService->expects('create')->with($server, [
'database_host_id' => $host->id,
@ -124,7 +124,7 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase
$server = $this->createServerModel();
$node = Node::factory()->create(['location_id' => $server->location->id]);
$host = DatabaseHost::factory()->create(['node_id' => $node->id]);
$host = DatabaseHost::factory()->create();
$this->managementService->expects('create')->with($server, [
'database_host_id' => $host->id,