mirror of
https://github.com/hanzoai/beego.git
synced 2026-11-17 13:19:25 +00:00
Faithful fork of upstream beego v1.12.12 with two changes only: - module path github.com/beego/beego -> github.com/hanzoai/beego (all internal imports repointed) - orm sqlite3 test driver mattn/go-sqlite3 -> hanzoai/csqlite (drop-in); drops the bogus 'mattn/go-sqlite3 v2.0.3+incompatible' pin that poisoned every consumer's module graph via beego v1's go.mod. go build ./... green; go list -deps mattn = 0; grep mattn go.mod = 0. Behavior identical to upstream v1.12.12 (no logic changes). Lets ai repoint its beego-v1 web layer by import path only, preserving exact runtime behavior.
33 lines
1.4 KiB
Go
33 lines
1.4 KiB
Go
// Package migration enables you to generate migrations back and forth. It generates both migrations.
|
|
//
|
|
// //Creates a table
|
|
// m.CreateTable("tablename","InnoDB","utf8");
|
|
//
|
|
// //Alter a table
|
|
// m.AlterTable("tablename")
|
|
//
|
|
// Standard Column Methods
|
|
// * SetDataType
|
|
// * SetNullable
|
|
// * SetDefault
|
|
// * SetUnsigned (use only on integer types unless produces error)
|
|
//
|
|
// //Sets a primary column, multiple calls allowed, standard column methods available
|
|
// m.PriCol("id").SetAuto(true).SetNullable(false).SetDataType("INT(10)").SetUnsigned(true)
|
|
//
|
|
// //UniCol Can be used multiple times, allows standard Column methods. Use same "index" string to add to same index
|
|
// m.UniCol("index","column")
|
|
//
|
|
// //Standard Column Initialisation, can call .Remove() after NewCol("") on alter to remove
|
|
// m.NewCol("name").SetDataType("VARCHAR(255) COLLATE utf8_unicode_ci").SetNullable(false)
|
|
// m.NewCol("value").SetDataType("DOUBLE(8,2)").SetNullable(false)
|
|
//
|
|
// //Rename Columns , only use with Alter table, doesn't works with Create, prefix standard column methods with "Old" to
|
|
// //create a true reversible migration eg: SetOldDataType("DOUBLE(12,3)")
|
|
// m.RenameColumn("from","to")...
|
|
//
|
|
// //Foreign Columns, single columns are only supported, SetOnDelete & SetOnUpdate are available, call appropriately.
|
|
// //Supports standard column methods, automatic reverse.
|
|
// m.ForeignCol("local_col","foreign_col","foreign_table")
|
|
package migration
|