2014-03-10 13:28:04 +00:00
|
|
|
package migrate
|
|
|
|
|
|
|
|
type rev20140310104446 struct{}
|
|
|
|
|
|
|
|
var AddOpenInvitationColumn = &rev20140310104446{}
|
|
|
|
|
|
|
|
func (r *rev20140310104446) Revision() int64 {
|
|
|
|
return 20140310104446
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *rev20140310104446) Up(mg *MigrationDriver) error {
|
2014-03-12 01:33:04 +00:00
|
|
|
// Suppress error here for backward compatibility
|
|
|
|
_, err := mg.AddColumn("settings", "open_invitations BOOLEAN")
|
|
|
|
_, err = mg.Tx.Exec("UPDATE settings SET open_invitations=0 WHERE open_invitations IS NULL")
|
2014-03-10 13:28:04 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *rev20140310104446) Down(mg *MigrationDriver) error {
|
2014-03-16 03:52:28 +00:00
|
|
|
_, err := mg.DropColumns("settings", "open_invitations")
|
2014-03-10 13:28:04 +00:00
|
|
|
return err
|
|
|
|
}
|