expect

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddColumnOp1 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name:     "bar",
		Type:     "int",
		Nullable: true,
	},
}
View Source
var AddColumnOp10 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name: "bar",
		Type: "int",
		Generated: &migrations.ColumnGenerated{
			Expression: "123",
		},
	},
}
View Source
var AddColumnOp2 = &migrations.OpAddColumn{
	Table: "schema.foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name:     "bar",
		Type:     "int",
		Nullable: true,
	},
}
View Source
var AddColumnOp3 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name:     "bar",
		Type:     "int",
		Nullable: true,
	},
}
View Source
var AddColumnOp4 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name:     "bar",
		Type:     "int",
		Unique:   true,
		Nullable: true,
	},
}
View Source
var AddColumnOp5 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name: "bar",
		Type: "int",
		Pk:   true,
	},
}
View Source
var AddColumnOp6 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name:     "bar",
		Type:     "int",
		Nullable: true,
		Check: &migrations.CheckConstraint{
			Constraint: "bar > 0",
			Name:       "foo_bar_check",
		},
	},
}
View Source
var AddColumnOp7 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name:     "bar",
		Type:     "int",
		Nullable: true,
		Check: &migrations.CheckConstraint{
			Constraint: "bar > 0",
			Name:       "check_bar",
		},
	},
}
View Source
var AddColumnOp8 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name:     "bar",
		Type:     "int",
		Nullable: false,
	},
}
View Source
var AddColumnOp9 = &migrations.OpAddColumn{
	Table: "foo",
	Up:    sql2pgroll.PlaceHolderSQL,
	Column: migrations.Column{
		Name: "bar",
		Type: "int",
		Generated: &migrations.ColumnGenerated{
			Identity: &migrations.ColumnGeneratedIdentity{
				UserSpecifiedValues: migrations.ColumnGeneratedIdentityUserSpecifiedValuesBYDEFAULT,
			},
		},
	},
}
View Source
var AddForeignKeyOp2 = &migrations.OpCreateConstraint{
	Columns: []string{"a"},
	Name:    "fk_bar_c",
	References: &migrations.TableForeignKeyReference{
		Columns:   []string{"c"},
		OnDelete:  migrations.ForeignKeyActionNOACTION,
		OnUpdate:  migrations.ForeignKeyActionNOACTION,
		MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
		Table:     "bar",
	},
	Table: "foo",
	Type:  migrations.OpCreateConstraintTypeForeignKey,
	Up: map[string]string{
		"a": sql2pgroll.PlaceHolderSQL,
	},
	Down: map[string]string{
		"a": sql2pgroll.PlaceHolderSQL,
	},
}
View Source
var AddForeignKeyOp3 = &migrations.OpCreateConstraint{
	Columns: []string{"a"},
	Name:    "fk_bar_c",
	References: &migrations.TableForeignKeyReference{
		Columns:   []string{"c"},
		OnDelete:  migrations.ForeignKeyActionNOACTION,
		OnUpdate:  migrations.ForeignKeyActionNOACTION,
		MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
		Table:     "schema_a.bar",
	},
	Table: "schema_a.foo",
	Type:  migrations.OpCreateConstraintTypeForeignKey,
	Up: map[string]string{
		"a": sql2pgroll.PlaceHolderSQL,
	},
	Down: map[string]string{
		"a": sql2pgroll.PlaceHolderSQL,
	},
}
View Source
var AlterColumnOp1 = &migrations.OpAlterColumn{
	Table:    "foo",
	Column:   "a",
	Nullable: ptr(false),
	Up:       sql2pgroll.PlaceHolderSQL,
	Down:     sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp10 = &migrations.OpAlterColumn{
	Table:   "foo",
	Column:  "bar",
	Default: nullable.NewNullableWithValue("b'0101'"),
	Up:      sql2pgroll.PlaceHolderSQL,
	Down:    sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp11 = &migrations.OpAlterColumn{
	Table:   "foo",
	Column:  "bar",
	Default: nullable.NewNullableWithValue("now()"),
	Up:      sql2pgroll.PlaceHolderSQL,
	Down:    sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp12 = &migrations.OpAlterColumn{
	Table:   "foo",
	Column:  "bar",
	Default: nullable.NewNullableWithValue("(first_name || ' ') || last_name"),
	Up:      sql2pgroll.PlaceHolderSQL,
	Down:    sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp2 = &migrations.OpAlterColumn{
	Table:    "foo",
	Column:   "a",
	Nullable: ptr(true),
	Up:       sql2pgroll.PlaceHolderSQL,
	Down:     sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp3 = &migrations.OpAlterColumn{
	Table:  "foo",
	Column: "a",
	Type:   ptr("text"),
	Up:     sql2pgroll.PlaceHolderSQL,
	Down:   sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp5 = &migrations.OpAlterColumn{
	Table:   "foo",
	Column:  "bar",
	Default: nullable.NewNullableWithValue("'baz'"),
	Up:      sql2pgroll.PlaceHolderSQL,
	Down:    sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp6 = &migrations.OpAlterColumn{
	Table:   "foo",
	Column:  "bar",
	Default: nullable.NewNullableWithValue("123"),
	Up:      sql2pgroll.PlaceHolderSQL,
	Down:    sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp7 = &migrations.OpAlterColumn{
	Table:   "foo",
	Column:  "bar",
	Default: nullable.NewNullNullable[string](),
	Up:      sql2pgroll.PlaceHolderSQL,
	Down:    sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp8 = &migrations.OpAlterColumn{
	Table:   "foo",
	Column:  "bar",
	Default: nullable.NewNullableWithValue("123.456"),
	Up:      sql2pgroll.PlaceHolderSQL,
	Down:    sql2pgroll.PlaceHolderSQL,
}
View Source
var AlterColumnOp9 = &migrations.OpAlterColumn{
	Table:   "foo",
	Column:  "bar",
	Default: nullable.NewNullableWithValue("true"),
	Up:      sql2pgroll.PlaceHolderSQL,
	Down:    sql2pgroll.PlaceHolderSQL,
}
View Source
var CreateConstraintOp1 = &migrations.OpCreateConstraint{
	Type:    migrations.OpCreateConstraintTypeUnique,
	Name:    "bar",
	Table:   "foo",
	Columns: []string{"a"},
	Down:    map[string]string{"a": sql2pgroll.PlaceHolderSQL},
	Up:      map[string]string{"a": sql2pgroll.PlaceHolderSQL},
}
View Source
var CreateConstraintOp2 = &migrations.OpCreateConstraint{
	Type:    migrations.OpCreateConstraintTypeUnique,
	Name:    "bar",
	Table:   "foo",
	Columns: []string{"a", "b"},
	Down: map[string]string{
		"a": sql2pgroll.PlaceHolderSQL,
		"b": sql2pgroll.PlaceHolderSQL,
	},
	Up: map[string]string{
		"a": sql2pgroll.PlaceHolderSQL,
		"b": sql2pgroll.PlaceHolderSQL,
	},
}
View Source
var CreateIndexOp1 = &migrations.OpCreateIndex{
	Name:    "idx_name",
	Table:   "foo",
	Columns: []migrations.IndexField{{Column: "bar"}},
	Method:  migrations.OpCreateIndexMethodBtree,
}
View Source
var CreateIndexOp10 = &migrations.OpCreateIndex{
	Name:   "idx_name",
	Table:  "foo",
	Method: migrations.OpCreateIndexMethodBtree,
	Columns: []migrations.IndexField{
		{
			Column: "bar",
			Opclass: ptr(migrations.IndexFieldOpclass{
				Name:   "opclass",
				Params: []string{"test=test"},
			}),
		},
	},
}
View Source
var CreateIndexOp11 = &migrations.OpCreateIndex{
	Name:   "idx_name",
	Table:  "foo",
	Method: migrations.OpCreateIndexMethodBtree,
	Columns: []migrations.IndexField{
		{
			Column: "bar",
			Opclass: ptr(migrations.IndexFieldOpclass{
				Name:   "opclass1",
				Params: []string{},
			}),
		},
		{
			Column: "baz",
			Opclass: ptr(migrations.IndexFieldOpclass{
				Name:   "opclass2",
				Params: []string{},
			}),
		},
	},
}
View Source
var CreateIndexOp12 = &migrations.OpCreateIndex{
	Name:  "idx_name",
	Table: "foo",
	Columns: []migrations.IndexField{
		{Column: "bar", Sort: migrations.IndexFieldSortASC},
	},
	Method: migrations.OpCreateIndexMethodBtree,
}
View Source
var CreateIndexOp2 = &migrations.OpCreateIndex{
	Name:    "idx_name",
	Table:   "schema.foo",
	Columns: []migrations.IndexField{{Column: "bar"}},
	Method:  migrations.OpCreateIndexMethodBtree,
}
View Source
var CreateIndexOp3 = &migrations.OpCreateIndex{
	Name:    "idx_name",
	Table:   "foo",
	Columns: []migrations.IndexField{{Column: "bar"}, {Column: "baz"}},
	Method:  migrations.OpCreateIndexMethodBtree,
}
View Source
var CreateIndexOp4 = &migrations.OpCreateIndex{
	Name:    "idx_name",
	Table:   "foo",
	Columns: []migrations.IndexField{{Column: "bar"}},
	Method:  migrations.OpCreateIndexMethodBtree,
	Unique:  true,
}
View Source
var CreateIndexOp5 = &migrations.OpCreateIndex{
	Name:      "idx_name",
	Table:     "foo",
	Columns:   []migrations.IndexField{{Column: "bar"}},
	Method:    migrations.OpCreateIndexMethodBtree,
	Predicate: "foo > 0",
}
View Source
var CreateIndexOp6 = &migrations.OpCreateIndex{
	Name:   "idx_name",
	Table:  "foo",
	Method: migrations.OpCreateIndexMethodBtree,
	Columns: []migrations.IndexField{
		{Column: "bar", Collate: "en_us"},
	},
}
View Source
var CreateIndexOp7 = &migrations.OpCreateIndex{
	Name:   "idx_name",
	Table:  "foo",
	Method: migrations.OpCreateIndexMethodBtree,
	Columns: []migrations.IndexField{
		{Column: "bar", Sort: migrations.IndexFieldSortDESC},
	},
}
View Source
var CreateIndexOp8 = &migrations.OpCreateIndex{
	Name:   "idx_name",
	Table:  "foo",
	Method: migrations.OpCreateIndexMethodBtree,
	Columns: []migrations.IndexField{
		{Column: "bar", Nulls: ptr(migrations.IndexFieldNullsFIRST)},
	},
}
View Source
var CreateIndexOp9 = &migrations.OpCreateIndex{
	Name:   "idx_name",
	Table:  "foo",
	Method: migrations.OpCreateIndexMethodBtree,
	Columns: []migrations.IndexField{
		{Column: "bar", Nulls: ptr(migrations.IndexFieldNullsLAST)},
	},
}
View Source
var CreateTableOp1 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
	},
}
View Source
var CreateTableOp10 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			Check: &migrations.CheckConstraint{
				Name:       "foo_a_check",
				Constraint: "a > 0",
			},
		},
	},
}
View Source
var CreateTableOp11 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "timestamptz",
			Nullable: true,
			Default:  ptr("now()"),
		},
	},
}
View Source
var CreateTableOp12 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			References: &migrations.ForeignKeyReference{
				Name:      "foo_a_fkey",
				Table:     "bar",
				Column:    "b",
				MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
				OnDelete:  migrations.ForeignKeyActionNOACTION,
				OnUpdate:  migrations.ForeignKeyActionNOACTION,
			},
		},
	},
}
View Source
var CreateTableOp13 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			References: &migrations.ForeignKeyReference{
				Name:      "foo_a_fkey",
				Table:     "bar",
				Column:    "b",
				MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
				OnDelete:  migrations.ForeignKeyActionRESTRICT,
				OnUpdate:  migrations.ForeignKeyActionNOACTION,
			},
		},
	},
}
View Source
var CreateTableOp14 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			References: &migrations.ForeignKeyReference{
				Name:      "foo_a_fkey",
				Table:     "bar",
				Column:    "b",
				MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
				OnDelete:  migrations.ForeignKeyActionSETNULL,
				OnUpdate:  migrations.ForeignKeyActionNOACTION,
			},
		},
	},
}
View Source
var CreateTableOp15 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			References: &migrations.ForeignKeyReference{
				Name:      "foo_a_fkey",
				Table:     "bar",
				Column:    "b",
				MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
				OnDelete:  migrations.ForeignKeyActionSETDEFAULT,
				OnUpdate:  migrations.ForeignKeyActionNOACTION,
			},
		},
	},
}
View Source
var CreateTableOp16 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			References: &migrations.ForeignKeyReference{
				Name:      "foo_a_fkey",
				Table:     "bar",
				Column:    "b",
				MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
				OnDelete:  migrations.ForeignKeyActionCASCADE,
				OnUpdate:  migrations.ForeignKeyActionNOACTION,
			},
		},
	},
}
View Source
var CreateTableOp17 = &migrations.OpCreateTable{
	Name: "schema.foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
	},
}
View Source
var CreateTableOp18 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			Check: &migrations.CheckConstraint{
				Name:       "my_check",
				Constraint: "a > 0",
			},
		},
	},
}
View Source
var CreateTableOp19 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			References: &migrations.ForeignKeyReference{
				Name:      "my_fk",
				Table:     "bar",
				Column:    "b",
				MatchType: migrations.ForeignKeyMatchTypeFULL,
				OnDelete:  migrations.ForeignKeyActionNOACTION,
				OnUpdate:  migrations.ForeignKeyActionNOACTION,
			},
		},
	},
}
View Source
var CreateTableOp2 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name: "a",
			Type: "int",
		},
	},
}
View Source
var CreateTableOp20 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
	},
}
View Source
var CreateTableOp21 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name: "a",
			Type: "serial",
			Pk:   true,
		},
		{
			Name:    "b",
			Type:    "int",
			Default: ptr("100"),
			Check: &migrations.CheckConstraint{
				Name:       "foo_b_check",
				Constraint: "b > 0",
			},
			Nullable: true,
		},
		{
			Name:   "c",
			Type:   "text",
			Unique: true,
		},
	},
}
View Source
var CreateTableOp22 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name: "a",
			Type: "serial",
			Pk:   true,
		},
		{
			Name:     "b",
			Type:     "text",
			Nullable: true,
		},
		{
			Name:     "c",
			Type:     "text",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeUnique,
			Columns:           []string{"b", "c"},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
		},
	},
}
View Source
var CreateTableOp23 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "b",
			Type:     "text",
			Nullable: true,
		},
		{
			Name:     "c",
			Type:     "text",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeUnique,
			Columns:           []string{"b"},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			IndexParameters: &migrations.ConstraintIndexParameters{
				IncludeColumns:    []string{"c"},
				StorageParameters: "fillfactor=70",
				Tablespace:        "my_tablespace",
			},
		},
	},
}
View Source
var CreateTableOp24 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeCheck,
			Check:             "a > 0",
			Columns:           []string{},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			NoInherit:         false,
		},
	},
}
View Source
var CreateTableOp25 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "b",
			Type:     "text",
			Nullable: true,
		},
		{
			Name:     "c",
			Type:     "text",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeCheck,
			Check:             "b = c",
			Columns:           []string{},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			NoInherit:         true,
		},
	},
}
View Source
var CreateTableOp26 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "b",
			Type:     "text",
			Nullable: true,
		},
		{
			Name:     "c",
			Type:     "text",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypePrimaryKey,
			Columns:           []string{"b"},
			NullsNotDistinct:  false,
			Deferrable:        true,
			InitiallyDeferred: false,
			NoInherit:         false,
		},
	},
}
View Source
var CreateTableOp27 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name: "b",
			Type: "bigint",
			Pk:   true,
			Generated: &migrations.ColumnGenerated{
				Identity: &migrations.ColumnGeneratedIdentity{
					UserSpecifiedValues: migrations.ColumnGeneratedIdentityUserSpecifiedValuesALWAYS,
					SequenceOptions:     "START 1 INCREMENT 1 MINVALUE 1 MAXVALUE 1000 CYCLE CACHE 1 ",
				},
			},
		},
	},
}
View Source
var CreateTableOp28 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "text",
			Nullable: true,
		},
		{
			Name: "b",
			Type: "text",
			Generated: &migrations.ColumnGenerated{
				Expression: "upper(a)",
			},
		},
	},
}
View Source
var CreateTableOp29 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeForeignKey,
			Columns:           []string{"a"},
			Name:              "foo_fk",
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			NoInherit:         false,
			References: &migrations.TableForeignKeyReference{
				Table:     "bar",
				Columns:   []string{"b"},
				OnDelete:  migrations.ForeignKeyActionNOACTION,
				OnUpdate:  migrations.ForeignKeyActionNOACTION,
				MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
			},
		},
	},
}
View Source
var CreateTableOp3 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "varchar(255)",
			Nullable: true,
		},
	},
}
View Source
var CreateTableOp30 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeForeignKey,
			Columns:           []string{"a"},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			NoInherit:         false,
			References: &migrations.TableForeignKeyReference{
				Table:     "bar",
				Columns:   []string{"b"},
				OnDelete:  migrations.ForeignKeyActionSETNULL,
				OnUpdate:  migrations.ForeignKeyActionCASCADE,
				MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
			},
		},
	},
}
View Source
var CreateTableOp31 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
		{
			Name:     "b",
			Type:     "int",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeForeignKey,
			Columns:           []string{"a", "b"},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			NoInherit:         false,
			References: &migrations.TableForeignKeyReference{
				Table:              "bar",
				Columns:            []string{"c", "d"},
				OnDelete:           migrations.ForeignKeyActionSETNULL,
				OnDeleteSetColumns: []string{"b"},
				OnUpdate:           migrations.ForeignKeyActionNOACTION,
				MatchType:          migrations.ForeignKeyMatchTypeSIMPLE,
			},
		},
	},
}
View Source
var CreateTableOp32 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
		{
			Name:     "b",
			Type:     "int",
			Nullable: true,
		},
		{
			Name:     "c",
			Type:     "int",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeForeignKey,
			Columns:           []string{"a", "b", "c"},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			NoInherit:         false,
			References: &migrations.TableForeignKeyReference{
				Table:     "bar",
				Columns:   []string{"d", "e", "f"},
				OnDelete:  migrations.ForeignKeyActionSETNULL,
				OnUpdate:  migrations.ForeignKeyActionCASCADE,
				MatchType: migrations.ForeignKeyMatchTypeSIMPLE,
			},
		},
	},
}
View Source
var CreateTableOp33 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
		},
		{
			Name:     "b",
			Type:     "int",
			Nullable: true,
		},
		{
			Name:     "c",
			Type:     "int",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeForeignKey,
			Columns:           []string{"a", "b", "c"},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			NoInherit:         false,
			References: &migrations.TableForeignKeyReference{
				Table:     "bar",
				Columns:   []string{"d", "e", "f"},
				OnDelete:  migrations.ForeignKeyActionNOACTION,
				OnUpdate:  migrations.ForeignKeyActionNOACTION,
				MatchType: migrations.ForeignKeyMatchTypeFULL,
			},
		},
	},
}
View Source
var CreateTableOp35 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "id",
			Type:     "int",
			Nullable: true,
		},
		{
			Name:     "s",
			Type:     "timestamptz",
			Nullable: true,
		},
		{
			Name:     "e",
			Type:     "timestamptz",
			Nullable: true,
		},
		{
			Name:     "canceled",
			Type:     "boolean",
			Nullable: true,
			Default:  ptr("false"),
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeExclude,
			Columns:           []string{},
			NullsNotDistinct:  false,
			Deferrable:        false,
			InitiallyDeferred: false,
			NoInherit:         false,
			Exclude: &migrations.ConstraintExclude{
				IndexMethod: "gist",
				Predicate:   "NOT canceled",
				Elements:    "id WITH =, tstzrange(s, e) WITH &&",
			},
		},
	},
}
View Source
var CreateTableOp36 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "id",
			Type:     "int",
			Nullable: true,
		},
		{
			Name:     "b",
			Type:     "text",
			Nullable: true,
		},
	},
	Constraints: []migrations.Constraint{
		{
			Type:              migrations.ConstraintTypeExclude,
			Columns:           []string{},
			NullsNotDistinct:  false,
			Deferrable:        true,
			InitiallyDeferred: true,
			NoInherit:         false,
			Exclude: &migrations.ConstraintExclude{
				IndexMethod: "btree",
				Elements:    "id WITH =",
			},
		},
	},
}
View Source
var CreateTableOp37 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			Check: &migrations.CheckConstraint{
				Name:       "foo_a_check",
				Constraint: "a > 0",
				NoInherit:  true,
			},
		},
	},
}
View Source
var CreateTableOp4 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "numeric(10, 2)",
			Nullable: true,
		},
	},
}
View Source
var CreateTableOp5 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "int",
			Nullable: true,
			Unique:   true,
		},
	},
}
View Source
var CreateTableOp6 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name: "a",
			Type: "int",
			Pk:   true,
		},
	},
}
View Source
var CreateTableOp7 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "text[]",
			Nullable: true,
		},
	},
}
View Source
var CreateTableOp8 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "text[5]",
			Nullable: true,
		},
	},
}
View Source
var CreateTableOp9 = &migrations.OpCreateTable{
	Name: "foo",
	Columns: []migrations.Column{
		{
			Name:     "a",
			Type:     "text[5][3]",
			Nullable: true,
		},
	},
}
View Source
var DropColumnOp1 = &migrations.OpDropColumn{
	Table:  "foo",
	Column: "bar",
	Down:   sql2pgroll.PlaceHolderSQL,
}
View Source
var DropIndexOp1 = &migrations.OpDropIndex{
	Name: "foo",
}
View Source
var DropIndexOp2 = &migrations.OpDropIndex{
	Name: "myschema.foo",
}
View Source
var DropTableOp1 = &migrations.OpDropTable{
	Name: "foo",
}
View Source
var DropTableOp2 = &migrations.OpDropTable{
	Name: "foo.bar",
}
View Source
var RenameColumnOp1 = &migrations.OpRenameColumn{
	Table: "foo",
	From:  "a",
	To:    "b",
}
View Source
var RenameConstraintOp1 = &migrations.OpRenameConstraint{
	Table: "foo",
	From:  "bar",
	To:    "baz",
}
View Source
var RenameTableOp1 = &migrations.OpRenameTable{
	From: "foo",
	To:   "bar",
}

Functions

func AddColumnOp1WithDefault added in v0.9.0

func AddColumnOp1WithDefault(def *string) *migrations.OpAddColumn

func AddColumnOp8WithOnDeleteAction added in v0.9.0

func AddColumnOp8WithOnDeleteAction(onDelete, onUpdate migrations.ForeignKeyAction, matchType migrations.ForeignKeyMatchType) *migrations.OpAddColumn

func AddColumnOp9WithOnDeleteActionUnnamed added in v0.9.0

func AddColumnOp9WithOnDeleteActionUnnamed(name string, onDelete, onUpdate migrations.ForeignKeyAction, matchType migrations.ForeignKeyMatchType) *migrations.OpAddColumn

func AddConstraintOp10ForeignKey added in v0.9.0

func AddConstraintOp10ForeignKey(onDelete, onUpdate migrations.ForeignKeyAction, matchType migrations.ForeignKeyMatchType) *migrations.OpCreateConstraint

func AddForeignKeyOp1WithParams added in v0.9.0

func AddForeignKeyOp1WithParams(matchType migrations.ForeignKeyMatchType, onDelete, onUpdate migrations.ForeignKeyAction) *migrations.OpCreateConstraint

func CreateIndexOp1WithMethod added in v0.9.0

func CreateIndexOp1WithMethod(method string) *migrations.OpCreateIndex

func CreateIndexOpWithStorageParam added in v0.9.0

func CreateIndexOpWithStorageParam(param string) *migrations.OpCreateIndex

func CreateTableOp34 added in v0.9.0

func CreateTableOp34(matchType migrations.ForeignKeyMatchType, onDelete, onUpdate migrations.ForeignKeyAction) *migrations.OpCreateTable

func OpDropConstraintWithTable added in v0.9.0

func OpDropConstraintWithTable(table string) *migrations.OpDropMultiColumnConstraint

func RawSQLOp

func RawSQLOp(sql string) *migrations.OpRawSQL

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL