1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-02 13:20:18 +00:00

Update: fixing some methods and adding documentation

Signed-off-by: Gnanakeethan Balasubramaniam <gnanakeethan@gmail.com>
This commit is contained in:
Gnanakeethan Balasubramaniam
2017-07-13 21:03:30 +05:30
parent e888fee4e0
commit 7c2ec075a4
3 changed files with 76 additions and 1 deletions

View File

@ -63,6 +63,19 @@ type RenameColumn struct {
Column
}
// CreateTable creates the table on system
func (m *Migration) CreateTable(tablename, engine, charset string, p ...func()) {
m.TableName = tablename
m.Engine = engine
m.Charset = charset
m.ModifyType = "create"
}
func (m *Migration) AlterTable(tablename string) {
m.TableName = tablename
m.ModifyType = "alter"
}
// NewCol creates a new standard column and attaches it to m struct
func (m *Migration) NewCol(name string) *Column {
col := &Column{Name: name}