mirror of
https://github.com/astaxie/beego.git
synced 2025-06-20 17:40:18 +00:00
.github
cache
config
context
grace
httplib
logs
migration
ddl.go
migration.go
orm
plugins
session
swagger
testing
toolbox
utils
validation
.gitignore
.gosimpleignore
.travis.yml
CONTRIBUTING.md
LICENSE
README.md
admin.go
admin_test.go
adminui.go
app.go
beego.go
config.go
config_test.go
controller.go
controller_test.go
doc.go
error.go
error_test.go
filter.go
filter_test.go
flash.go
flash_test.go
hooks.go
log.go
mime.go
namespace.go
namespace_test.go
parser.go
policy.go
router.go
router_test.go
staticfile.go
staticfile_test.go
template.go
template_test.go
templatefunc.go
templatefunc_test.go
tree.go
tree_test.go

Summary: The database migrations now can be created using the methods on the migration struct. it does not break any existing migration features. it upgrades the migration struct and adds few more struct types so that the migrations can be efficiently generated for create, alter, reverse, drop. Current Features: * Supports creation of columns * `m.NewCol("name").SetDataType("VARCHAR(10)").SetNullable("true")` * **NOTE** `SetNullable` & `SetDefault` methods should not be called on same column for consistency * Supports addition of primary keys * `m.PriCol("id").SetDataType("INT(10)").SetNullable("true")` * **NOTE** `setAuto(true)` can be only called on Primary keys * Supports addition of unique keys * `m.UniCol("unique_index","column_name").SetDataType("VARCHAR(23)").SetNullable("true")` * **NOTE** `UniCol` can be called again with the same index name to add column to the index * Supports rename of columns * `m.RenameColumn("from_name","to_name")` * Allows standard column methods and methods such that, `SetOldDefault` allows reversibility of renames * TODO: * ForeignKey Signed-off-by: Gnanakeethan Balasubramaniam <gnanakeethan@gmail.com>