Documentation ¶
Index ¶
- type Migration
- type PivotMigration
- type PivotMigrationEntry
- type Table
- func (t *Table) Column(name string, colType string, options fizz.Options) error
- func (t Table) Fizz() string
- func (t *Table) ForeignKey(column string, refs interface{}, options fizz.Options) error
- func (t *Table) HasColumns(args ...string) bool
- func (t *Table) PrimaryKey(pk ...string) error
- func (t Table) String() string
- func (t *Table) Timestamp(name string) error
- func (t Table) UnFizz() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct {
// contains filtered or unexported fields
}
Migration generator
func (*Migration) GetContent ¶
GetContent return generated migration content
type PivotMigration ¶
type PivotMigration struct { Tables []PivotMigrationEntry Config *config.Config }
PivotMigration generator
func (*PivotMigration) Generate ¶
func (p *PivotMigration) Generate() error
Generate generates pivot migration
func (*PivotMigration) Init ¶
func (p *PivotMigration) Init(tables []PivotMigrationEntry, conf *config.Config)
Init initializes pivot generator
type PivotMigrationEntry ¶
PivotMigrationEntry
type Table ¶
type Table struct { Name string `db:"name"` Columns []fizz.Column Indexes []fizz.Index ForeignKeys []fizz.ForeignKey Options map[string]interface{} // contains filtered or unexported fields }
Table is the table definition for fizz.
func (*Table) ForeignKey ¶
ForeignKey adds a new foreign key to the table definition.
func (*Table) HasColumns ¶
HasColumns checks if the Table has all the given columns.
func (*Table) PrimaryKey ¶
PrimaryKey adds a primary key to the table. It's useful to define a composite primary key.
Click to show internal directories.
Click to hide internal directories.