Skip to content

Commit

Permalink
atlas/schema: added concurrent_index support
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Nov 28, 2023
1 parent 826d70f commit fbe7fb0
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
15 changes: 14 additions & 1 deletion api/v1alpha1/atlasschema_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions charts/atlas-operator/templates/crds/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions config/crd/bases/db.atlasgo.io_atlasschemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fbe7fb0

Please sign in to comment.