Skip to content

Commit

Permalink
Make doc comments follow Go conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanslade committed Nov 22, 2024
1 parent fcf4c17 commit cf2696c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/migrations/duplicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (d *duplicatorStmtBuilder) duplicateComment(column *schema.Column, asName s
)
}

// DiplicationName returns the name of a duplicated column.
// DuplicationName returns the name of a duplicated column.
func DuplicationName(name string) string {
return "_pgroll_dup_" + name
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"

_ "github.com/lib/pq"

"github.com/xataio/pgroll/pkg/db"
"github.com/xataio/pgroll/pkg/schema"
)
Expand Down Expand Up @@ -37,13 +38,15 @@ type Operation interface {
// IsolatedOperation is an operation that cannot be executed with other operations
// in the same migration.
type IsolatedOperation interface {
// this operation is isolated when executed on start, cannot be executed with other operations.
// IsIsolated defines where this operation is isolated when executed on start, cannot be executed
// with other operations.
IsIsolated() bool
}

// RequiresSchemaRefreshOperation is an operation that requires the resulting schema to be refreshed.
type RequiresSchemaRefreshOperation interface {
// this operation requires the resulting schema to be refreshed when executed on start
// RequiresSchemaRefresh defines if this operation requires the resulting schema to be refreshed when
// executed on start.
RequiresSchemaRefresh()
}

Expand Down
1 change: 1 addition & 0 deletions pkg/migrations/op_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
OpCreateConstraintName OpName = "create_constraint"

// Internal operation types used by `alter_column`

OpNameRenameColumn OpName = "rename_column"
OpNameSetUnique OpName = "set_unique"
OpNameSetNotNull OpName = "set_not_null"
Expand Down
2 changes: 1 addition & 1 deletion pkg/migrations/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/xataio/pgroll/pkg/schema"
)

// RenameDuplicatedColumn:
// RenameDuplicatedColumn
// * renames a duplicated column to its original name
// * renames any foreign keys on the duplicated column to their original name.
// * Validates and renames any temporary `CHECK` constraints on the duplicated column.
Expand Down
2 changes: 1 addition & 1 deletion pkg/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (t *Table) RenameColumn(from, to string) {
delete(t.Columns, from)
}

// PhysicalColumnNames returns the physical column names for the given virtual
// PhysicalColumnNamesFor returns the physical column names for the given virtual
// column names
func (t *Table) PhysicalColumnNamesFor(columnNames ...string) []string {
physicalNames := make([]string, 0, len(columnNames))
Expand Down

0 comments on commit cf2696c

Please sign in to comment.