Add cascade on tags
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
f0e761bc6d
commit
117a41e9ed
1 changed files with 4 additions and 4 deletions
|
|
@ -50,7 +50,7 @@ type Tag struct {
|
|||
Base
|
||||
|
||||
Name string `gorm:"type:varchar(64);uniqueIndex"`
|
||||
Pools []*Pool `gorm:"many2many:pool_tags;"`
|
||||
Pools []*Pool `gorm:"many2many:pool_tags;constraint:OnDelete:CASCADE"`
|
||||
}
|
||||
|
||||
type Pool struct {
|
||||
|
|
@ -65,7 +65,7 @@ type Pool struct {
|
|||
Flavor string `gorm:"index:idx_pool_type"`
|
||||
OSType params.OSType
|
||||
OSArch params.OSArch
|
||||
Tags []*Tag `gorm:"many2many:pool_tags;constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"`
|
||||
Tags []*Tag `gorm:"many2many:pool_tags;constraint:OnDelete:CASCADE"`
|
||||
Enabled bool
|
||||
// ExtraSpecs is an opaque json that gets sent to the provider
|
||||
// as part of the bootstrap params for instances. It can contain
|
||||
|
|
@ -144,7 +144,7 @@ type Instance struct {
|
|||
OSArch params.OSArch
|
||||
OSName string
|
||||
OSVersion string
|
||||
Addresses []Address `gorm:"foreignKey:InstanceID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"`
|
||||
Addresses []Address `gorm:"foreignKey:InstanceID;constraint:OnDelete:CASCADE"`
|
||||
Status common.InstanceStatus
|
||||
RunnerStatus common.RunnerStatus
|
||||
CallbackURL string
|
||||
|
|
@ -158,7 +158,7 @@ type Instance struct {
|
|||
PoolID uuid.UUID
|
||||
Pool Pool `gorm:"foreignKey:PoolID"`
|
||||
|
||||
StatusMessages []InstanceStatusUpdate `gorm:"foreignKey:InstanceID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"`
|
||||
StatusMessages []InstanceStatusUpdate `gorm:"foreignKey:InstanceID;constraint:OnDelete:CASCADE"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue