20 lines
539 B
Go
20 lines
539 B
Go
|
package devstar_v1_0
|
||
|
|
||
|
import (
|
||
|
"xorm.io/xorm"
|
||
|
)
|
||
|
|
||
|
// AddDeploymentTypeToAppStore adds deployment_type column to app_store and creates index
|
||
|
func AddDeploymentTypeToAppStore(x *xorm.Engine) error {
|
||
|
// add column if not exists (most DBs will ignore existing)
|
||
|
_, err := x.Exec("ALTER TABLE app_store ADD COLUMN deployment_type VARCHAR(20) NOT NULL DEFAULT 'docker'")
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
_, err = x.Exec("CREATE INDEX idx_app_store_deployment_type ON app_store(deployment_type)")
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return nil
|
||
|
}
|