|
|
|
@ -11,13 +11,13 @@ func addLocationCoordinateToRepo(engine *xorm.Engine) error {
|
|
|
|
|
tableName := "repository" |
|
|
|
|
switch engine.Dialect().URI().DBType { |
|
|
|
|
case schemas.POSTGRES: |
|
|
|
|
addColsQuery := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN location_coordinate VARCHAR(20);", tableName) |
|
|
|
|
addColsQuery := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN location_coordinates VARCHAR(1024);", tableName) |
|
|
|
|
_, err = engine.Exec(addColsQuery) |
|
|
|
|
case schemas.SQLITE: |
|
|
|
|
addColsQuery := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN location_coordinate TEXT;", tableName) |
|
|
|
|
addColsQuery := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN location_coordinates TEXT;", tableName) |
|
|
|
|
_, err = engine.Exec(addColsQuery) |
|
|
|
|
case schemas.MYSQL: |
|
|
|
|
addColsQuery := fmt.Sprintf("ALTER TABLE `%s` ADD COLUMN location_coordinate VARCHAR(20);", tableName) |
|
|
|
|
addColsQuery := fmt.Sprintf("ALTER TABLE `%s` ADD COLUMN location_coordinates VARCHAR(1024);", tableName) |
|
|
|
|
_, err = engine.Exec(addColsQuery) |
|
|
|
|
} |
|
|
|
|
if err != nil { |
|
|
|
|