Documentation ¶
Index ¶
- type Migration
- func (m *Migration) DownSQL() string
- func (m *Migration) LeadingComment() string
- func (m *Migration) Name() string
- func (m *Migration) ReadFromFile(path string) error
- func (m *Migration) SQL() string
- func (m *Migration) SetDownSQL(sql string)
- func (m *Migration) SetLeadingComment(comment string)
- func (m *Migration) SetName(name string)
- func (m *Migration) SetUpSQL(sql string)
- func (m *Migration) SetVersion(ver int64)
- func (m *Migration) UpSQL() string
- func (m *Migration) Version() int64
- func (m *Migration) WriteToFile(dirname string) (string, error)
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 ...
func LoadAllLaterThan ¶
LoadAllLaterThan ...
func (*Migration) LeadingComment ¶
LeadingComment returns the migration leading comment
func (*Migration) ReadFromFile ¶
ReadFromFile creates a migration file in the directory specified by "dir" and writes content to it based on this migration's fields.
func (*Migration) SQL ¶
SQL returns the migration SQL including leading comment, up SQL and down SQL.
func (*Migration) SetDownSQL ¶
SetDownSQL sets SQL for a "down" migration.
func (*Migration) SetLeadingComment ¶
SetLeadingComment sets the migration leading comment after sanitizng comment and prefixing it with "-- ".
Click to show internal directories.
Click to hide internal directories.