@@ -83,11 +83,12 @@ type TableConstraint interface {
8383
8484// IndexDefinition represents an index definition within CREATE TABLE
8585type IndexDefinition struct {
86- Name * Identifier
87- Columns []* ColumnWithSortOrder
88- Unique bool
89- IndexType * IndexType
90- IndexOptions []* IndexExpressionOption
86+ Name * Identifier
87+ Columns []* ColumnWithSortOrder
88+ Unique bool
89+ IndexType * IndexType
90+ IndexOptions []* IndexExpressionOption
91+ IncludeColumns []* ColumnReferenceExpression
9192}
9293
9394func (i * IndexDefinition ) node () {}
@@ -108,3 +109,41 @@ const (
108109 SortOrderAscending
109110 SortOrderDescending
110111)
112+
113+ // CheckConstraintDefinition represents a CHECK constraint
114+ type CheckConstraintDefinition struct {
115+ ConstraintIdentifier * Identifier
116+ CheckCondition BooleanExpression
117+ NotForReplication bool
118+ }
119+
120+ func (c * CheckConstraintDefinition ) node () {}
121+ func (c * CheckConstraintDefinition ) tableConstraint () {}
122+ func (c * CheckConstraintDefinition ) constraintDefinition () {}
123+
124+ // UniqueConstraintDefinition represents a UNIQUE or PRIMARY KEY constraint
125+ type UniqueConstraintDefinition struct {
126+ ConstraintIdentifier * Identifier
127+ Clustered bool
128+ IsPrimaryKey bool
129+ Columns []* ColumnWithSortOrder
130+ IndexType * IndexType
131+ }
132+
133+ func (u * UniqueConstraintDefinition ) node () {}
134+ func (u * UniqueConstraintDefinition ) tableConstraint () {}
135+ func (u * UniqueConstraintDefinition ) constraintDefinition () {}
136+
137+ // ForeignKeyConstraintDefinition represents a FOREIGN KEY constraint
138+ type ForeignKeyConstraintDefinition struct {
139+ ConstraintIdentifier * Identifier
140+ Columns []* Identifier
141+ ReferenceTableName * SchemaObjectName
142+ ReferencedColumns []* Identifier
143+ DeleteAction string
144+ UpdateAction string
145+ NotForReplication bool
146+ }
147+
148+ func (f * ForeignKeyConstraintDefinition ) node () {}
149+ func (f * ForeignKeyConstraintDefinition ) tableConstraint () {}
0 commit comments