소스 검색

attempt to add fk constraint to infra instead of db

Alexander Belanger 4 년 전
부모
커밋
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
 	// ------------------------------------------------------------------