Exemplo n.º 1
0
func TestAlterManager(t *testing.T) {
	relation := nodes.Relation("table")
	mgr := managers.Alteration(relation)

	// The following struct members should exist.
	_ = mgr.Tree

	// The following receiver methods should exist.
	_ = mgr.AddColumn(1, sql.String)
	_ = mgr.AddConstraint([]interface{}{1}, sql.Unique, 1, 2, 3)
	_ = mgr.SetAdapter(1)
	_, _ = mgr.ToSql()
}
Exemplo n.º 2
0
// CreateTable returns an AlterManager from the managers package
// for generating SQL to alter existing tables.
func AlterTable(name string) *managers.AlterManager {
	relation := nodes.Relation(name)
	return managers.Alteration(relation)
}