Skip to content

Commit 002913d

Browse files
mjonssAilinKid
andauthored
add placement rules to schema and partition (pingcap#1340)
Co-authored-by: Arenatlx <[email protected]>
1 parent 3ee1339 commit 002913d

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

model/model.go

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -858,11 +858,13 @@ type PartitionState struct {
858858

859859
// PartitionDefinition defines a single partition.
860860
type PartitionDefinition struct {
861-
ID int64 `json:"id"`
862-
Name CIStr `json:"name"`
863-
LessThan []string `json:"less_than"`
864-
InValues [][]string `json:"in_values"`
865-
Comment string `json:"comment,omitempty"`
861+
ID int64 `json:"id"`
862+
Name CIStr `json:"name"`
863+
LessThan []string `json:"less_than"`
864+
InValues [][]string `json:"in_values"`
865+
PlacementPolicyRef *PolicyRefInfo `json:"policy_ref_info"`
866+
DirectPlacementOpts *PlacementSettings `json:"placement_settings"`
867+
Comment string `json:"comment,omitempty"`
866868
}
867869

868870
// Clone clones ConstraintInfo.
@@ -1042,12 +1044,14 @@ func (fk *FKInfo) Clone() *FKInfo {
10421044

10431045
// DBInfo provides meta data describing a DB.
10441046
type DBInfo struct {
1045-
ID int64 `json:"id"` // Database ID
1046-
Name CIStr `json:"db_name"` // DB name.
1047-
Charset string `json:"charset"`
1048-
Collate string `json:"collate"`
1049-
Tables []*TableInfo `json:"-"` // Tables in the DB.
1050-
State SchemaState `json:"state"`
1047+
ID int64 `json:"id"` // Database ID
1048+
Name CIStr `json:"db_name"` // DB name.
1049+
Charset string `json:"charset"`
1050+
Collate string `json:"collate"`
1051+
Tables []*TableInfo `json:"-"` // Tables in the DB.
1052+
State SchemaState `json:"state"`
1053+
PlacementPolicyRef *PolicyRefInfo `json:"policy_ref_info"`
1054+
DirectPlacementOpts *PlacementSettings `json:"placement_settings"`
10511055
}
10521056

10531057
// Clone clones DBInfo.

0 commit comments

Comments
 (0)