From fef35aa8df13e485fa30ebdf4b79de393abf9031 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Tue, 14 Sep 2021 13:00:36 +0200 Subject: [PATCH] [parser] add placement rules to schema and partition (#1340) Co-authored-by: Arenatlx <314806019@qq.com> --- parser/model/model.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/parser/model/model.go b/parser/model/model.go index a52dd445e3..c0b30dec60 100644 --- a/parser/model/model.go +++ b/parser/model/model.go @@ -858,11 +858,13 @@ type PartitionState struct { // PartitionDefinition defines a single partition. type PartitionDefinition struct { - ID int64 `json:"id"` - Name CIStr `json:"name"` - LessThan []string `json:"less_than"` - InValues [][]string `json:"in_values"` - Comment string `json:"comment,omitempty"` + ID int64 `json:"id"` + Name CIStr `json:"name"` + LessThan []string `json:"less_than"` + InValues [][]string `json:"in_values"` + PlacementPolicyRef *PolicyRefInfo `json:"policy_ref_info"` + DirectPlacementOpts *PlacementSettings `json:"placement_settings"` + Comment string `json:"comment,omitempty"` } // Clone clones ConstraintInfo. @@ -1042,12 +1044,14 @@ func (fk *FKInfo) Clone() *FKInfo { // DBInfo provides meta data describing a DB. type DBInfo struct { - ID int64 `json:"id"` // Database ID - Name CIStr `json:"db_name"` // DB name. - Charset string `json:"charset"` - Collate string `json:"collate"` - Tables []*TableInfo `json:"-"` // Tables in the DB. - State SchemaState `json:"state"` + ID int64 `json:"id"` // Database ID + Name CIStr `json:"db_name"` // DB name. + Charset string `json:"charset"` + Collate string `json:"collate"` + Tables []*TableInfo `json:"-"` // Tables in the DB. + State SchemaState `json:"state"` + PlacementPolicyRef *PolicyRefInfo `json:"policy_ref_info"` + DirectPlacementOpts *PlacementSettings `json:"placement_settings"` } // Clone clones DBInfo.