Documentation ¶
Index ¶
- func DropTableColumns(sess *xorm.Session, tableName string, columnNames ...string) (err error)
- func HashToken(token, salt string) string
- func MainTest(m *testing.M)
- func ModifyColumn(x *xorm.Engine, tableName string, col *schemas.Column) error
- func PrepareTestEnv(t *testing.T, skip int, syncModels ...any) (*xorm.Engine, func())
- func RecreateTable(sess *xorm.Session, bean any) error
- func RecreateTables(beans ...any) func(*xorm.Engine) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropTableColumns ¶
WARNING: YOU MUST COMMIT THE SESSION AT THE END
func ModifyColumn ¶
ModifyColumn will modify column's type or other property. SQLITE is not supported
func PrepareTestEnv ¶
PrepareTestEnv prepares the test environment and reset the database. The skip parameter should usually be 0. Provide models to be sync'd with the database - in particular any models you expect fixtures to be loaded from.
fixtures in `models/migrations/fixtures/<TestName>` will be loaded automatically
func RecreateTable ¶
RecreateTable will recreate the table using the newly provided bean definition and move all data to that new table WARNING: YOU MUST PROVIDE THE FULL BEAN DEFINITION WARNING: YOU MUST COMMIT THE SESSION AT THE END
Types ¶
This section is empty.