Skip to content

Commit

Permalink
Update doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanslade committed Dec 13, 2024
1 parent 7abd366 commit 21eebb1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/sql2pgroll/alter_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@ func convertAlterTableAlterColumnType(stmt *pgq.AlterTableStmt, cmd *pgq.AlterTa
}, nil
}

// convertAlterTableAddConstraint converts SQL statements like:
// convertAlterTableAddConstraint converts SQL statements that add UNIQUE or FOREIGN KEY constraints,
// for example:
//
// `ALTER TABLE foo ADD CONSTRAINT bar UNIQUE (a)`
// `ALTER TABLE foo ADD CONSTRAINT fk_bar_c FOREIGN KEY (a) REFERENCES bar (c);`
//
// To an OpCreateConstraint operation.
// An OpCreateConstraint operation is returned.
func convertAlterTableAddConstraint(stmt *pgq.AlterTableStmt, cmd *pgq.AlterTableCmd) (migrations.Operation, error) {
node, ok := cmd.GetDef().Node.(*pgq.Node_Constraint)
if !ok {
Expand Down

0 comments on commit 21eebb1

Please sign in to comment.