Documentation ¶
Index ¶
- type Context
- type Migrations
- func (r Migrations) CreateTableIfNotExists() error
- func (r Migrations) Delete(migrations ...interface{}) error
- func (r Migrations) DropTablesIfExists() error
- func (r Migrations) GetDBMap() *gorp.DbMap
- func (r Migrations) GetMigrations() ([]dao.Migration, error)
- func (r Migrations) GetMigrationsSorted() (dao.Migrations, error)
- func (r Migrations) Insert(migrations ...interface{}) error
- type Unittests
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Migrations Migrations Unittests Unittests // contains filtered or unexported fields }
Context defines the global database context with access to all database available tables and operations.
type Migrations ¶
type Migrations struct {
// contains filtered or unexported fields
}
Migrations defines a wrapper struct for all of the migrations table operations.
func (Migrations) CreateTableIfNotExists ¶
func (r Migrations) CreateTableIfNotExists() error
CreateTableIfNotExists create migrations table if one does not exist.
func (Migrations) Delete ¶
func (r Migrations) Delete(migrations ...interface{}) error
Delete instructs a migration record to be deleted from the database.
func (Migrations) DropTablesIfExists ¶
func (r Migrations) DropTablesIfExists() error
DropTablesIfExists drops a table from the database if already exists.
func (Migrations) GetDBMap ¶
func (r Migrations) GetDBMap() *gorp.DbMap
GetDBMap returns the underlying migrations table database model object.
func (Migrations) GetMigrations ¶
func (r Migrations) GetMigrations() ([]dao.Migration, error)
GetMigrations returns database migration records.
func (Migrations) GetMigrationsSorted ¶
func (r Migrations) GetMigrationsSorted() (dao.Migrations, error)
GetMigrationsSorted returns sorted database migration records.
func (Migrations) Insert ¶
func (r Migrations) Insert(migrations ...interface{}) error
Insert adds a migration record to the database.
Click to show internal directories.
Click to hide internal directories.