Răsfoiți Sursa

attempt to add fk constraint to infra instead of db

Alexander Belanger 4 ani în urmă
părinte
comite
e67bd8d7d9
2 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 0 1
      internal/models/database.go
  2. 2 0
      internal/models/infra.go

+ 0 - 1
internal/models/database.go

@@ -14,7 +14,6 @@ type Database struct {
 	ClusterID uint `json:"cluster_id"`
 
 	InfraID uint `json:"infra_id"`
-	Infra   Infra
 
 	InstanceID       string `json:"rds_instance_id"`
 	InstanceEndpoint string `json:"rds_connection_endpoint"`

+ 2 - 0
internal/models/infra.go

@@ -61,6 +61,8 @@ type Infra struct {
 	// The database id for the infra, if this infra provisioned a database
 	DatabaseID uint
 
+	Database Database
+
 	// ------------------------------------------------------------------
 	// All fields below this line are encrypted before storage
 	// ------------------------------------------------------------------