github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/database/migrate/201402211147_github_enterprise_support.go (about)

     1  package migrate
     2  
     3  type Rev3 struct{}
     4  
     5  var GitHubEnterpriseSupport = &Rev3{}
     6  
     7  func (r *Rev3) Revision() int64 {
     8  	return 201402211147
     9  }
    10  
    11  func (r *Rev3) Up(mg *MigrationDriver) error {
    12  	_, err := mg.AddColumn("settings", "github_domain VARCHAR(255)")
    13  	if err != nil {
    14  		return err
    15  	}
    16  	_, err = mg.AddColumn("settings", "github_apiurl VARCHAR(255)")
    17  
    18  	mg.Tx.Exec("update settings set github_domain=?", "github.com")
    19  	mg.Tx.Exec("update settings set github_apiurl=?", "https://api.github.com")
    20  	return err
    21  }
    22  
    23  func (r *Rev3) Down(mg *MigrationDriver) error {
    24  	_, err := mg.DropColumns("settings", "github_domain", "github_apiurl")
    25  	return err
    26  }