2014-02-16 05:55:11 +00:00
|
|
|
package migrate
|
|
|
|
|
|
|
|
type Rev3 struct{}
|
|
|
|
|
|
|
|
var GitHubEnterpriseSupport = &Rev3{}
|
|
|
|
|
|
|
|
func (r *Rev3) Revision() int64 {
|
|
|
|
return 201402211147
|
|
|
|
}
|
|
|
|
|
2014-03-08 05:19:28 +00:00
|
|
|
func (r *Rev3) Up(mg *MigrationDriver) error {
|
|
|
|
_, err := mg.AddColumn("settings", "github_domain VARCHAR(255)")
|
2014-02-18 05:48:31 +00:00
|
|
|
if err != nil {
|
2014-02-16 05:55:11 +00:00
|
|
|
return err
|
|
|
|
}
|
2014-03-08 05:19:28 +00:00
|
|
|
_, err = mg.AddColumn("settings", "github_apiurl VARCHAR(255)")
|
2014-02-18 06:08:06 +00:00
|
|
|
|
2014-03-08 05:19:28 +00:00
|
|
|
mg.Tx.Exec("update settings set github_domain=?", "github.com")
|
|
|
|
mg.Tx.Exec("update settings set github_apiurl=?", "https://api.github.com")
|
2014-02-16 05:55:11 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2014-03-08 05:19:28 +00:00
|
|
|
func (r *Rev3) Down(mg *MigrationDriver) error {
|
|
|
|
_, err := mg.DropColumns("settings", []string{"github_domain", "github_apiurl"})
|
2014-02-16 05:55:11 +00:00
|
|
|
return err
|
|
|
|
}
|