Просмотр исходного кода

attempt to add fk constraint to infra instead of db

Alexander Belanger 4 лет назад
Родитель
Сommit
e67bd8d7d9
2 измененных файлов с 2 добавлено и 1 удалено
  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
 	// ------------------------------------------------------------------