diff --git a/api/v1alpha1/atlasschema_types.go b/api/v1alpha1/atlasschema_types.go index 17b40b58..af801c13 100644 --- a/api/v1alpha1/atlasschema_types.go +++ b/api/v1alpha1/atlasschema_types.go @@ -74,6 +74,9 @@ type ( DevURLFrom Secret `json:"devURLFrom,omitempty"` // Exclude a list of glob patterns used to filter existing resources being taken into account. Exclude []string `json:"exclude,omitempty"` + // TxMode defines the transaction mode to use when applying the schema. + // +kubebuilder:default=file + TxMode TransactionMode `json:"txMode,omitempty"` // Policy defines the policies to apply when managing the schema change lifecycle. Policy Policy `json:"policy,omitempty"` // The names of the schemas (named databases) on the target database to be managed. @@ -100,7 +103,8 @@ type ( } // Diff defines the diff policies to apply when planning schema changes. Diff struct { - Skip SkipChanges `json:"skip,omitempty"` + ConcurrentIndex ConcurrentIndex `json:"concurrent_index,omitempty"` + Skip SkipChanges `json:"skip,omitempty"` } // SkipChanges represents the skip changes policy. SkipChanges struct { @@ -135,6 +139,15 @@ type ( // +optional ModifyForeignKey bool `json:"modify_foreign_key,omitempty"` } + ConcurrentIndex struct { + // +optional + Create bool `json:"create,omitempty"` + // +optional + Drop bool `json:"drop,omitempty"` + } + // TransactionMode + // +kubebuilder:validation:Enum=file;all;none + TransactionMode string ) func init() { diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 01cc9a01..113481ca 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -264,6 +264,21 @@ func (in *Cloud) DeepCopy() *Cloud { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConcurrentIndex) DeepCopyInto(out *ConcurrentIndex) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConcurrentIndex. +func (in *ConcurrentIndex) DeepCopy() *ConcurrentIndex { + if in == nil { + return nil + } + out := new(ConcurrentIndex) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Credentials) DeepCopyInto(out *Credentials) { *out = *in @@ -292,6 +307,7 @@ func (in *Credentials) DeepCopy() *Credentials { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Diff) DeepCopyInto(out *Diff) { *out = *in + out.ConcurrentIndex = in.ConcurrentIndex out.Skip = in.Skip } diff --git a/charts/atlas-operator/templates/crds/crd.yaml b/charts/atlas-operator/templates/crds/crd.yaml index 021dc62d..dfb00870 100644 --- a/charts/atlas-operator/templates/crds/crd.yaml +++ b/charts/atlas-operator/templates/crds/crd.yaml @@ -523,6 +523,13 @@ spec: description: Diff defines the diff policies to apply when planning schema changes. properties: + concurrent_index: + properties: + create: + type: boolean + drop: + type: boolean + type: object skip: description: SkipChanges represents the skip changes policy. properties: @@ -603,6 +610,15 @@ spec: items: type: string type: array + txMode: + default: file + description: TxMode defines the transaction mode to use when applying + the schema. + enum: + - file + - all + - none + type: string url: description: URL of the target database schema. type: string diff --git a/config/crd/bases/db.atlasgo.io_atlasschemas.yaml b/config/crd/bases/db.atlasgo.io_atlasschemas.yaml index 0411b32e..655f9cbe 100644 --- a/config/crd/bases/db.atlasgo.io_atlasschemas.yaml +++ b/config/crd/bases/db.atlasgo.io_atlasschemas.yaml @@ -192,6 +192,13 @@ spec: description: Diff defines the diff policies to apply when planning schema changes. properties: + concurrent_index: + properties: + create: + type: boolean + drop: + type: boolean + type: object skip: description: SkipChanges represents the skip changes policy. properties: @@ -272,6 +279,15 @@ spec: items: type: string type: array + txMode: + default: file + description: TxMode defines the transaction mode to use when applying + the schema. + enum: + - file + - all + - none + type: string url: description: URL of the target database schema. type: string