-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ajuste en tabla de reingreso. udistrital/sga_cliente#860
- Loading branch information
JQuinteroC
committed
Mar 2, 2022
1 parent
0727bea
commit a3776d0
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
database/migrations/20220301_194850_ajuste_tabla_reintegro.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"io/ioutil" | ||
"strings" | ||
|
||
"github.com/astaxie/beego/migration" | ||
) | ||
|
||
// DO NOT MODIFY | ||
type AjusteTablaReintegro_20220301_194850 struct { | ||
migration.Migration | ||
} | ||
|
||
// DO NOT MODIFY | ||
func init() { | ||
m := &AjusteTablaReintegro_20220301_194850{} | ||
m.Created = "20220301_194850" | ||
|
||
migration.Register("AjusteTablaReintegro_20220301_194850", m) | ||
} | ||
|
||
// Run the migrations | ||
func (m *AjusteTablaReintegro_20220301_194850) Up() { | ||
// use m.SQL("CREATE TABLE ...") to make schema update | ||
file, err := ioutil.ReadFile("../scripts/20220301_194850_ajuste_tabla_reintegro.up.sql") | ||
if err != nil { | ||
// handle error | ||
fmt.Println(err) | ||
} | ||
|
||
requests := strings.Split(string(file), ";") | ||
|
||
for _, request := range requests { | ||
fmt.Println(request) | ||
m.SQL(request) | ||
// do whatever you need with result and error | ||
} | ||
} | ||
|
||
// Reverse the migrations | ||
func (m *AjusteTablaReintegro_20220301_194850) Down() { | ||
// use m.SQL("DROP TABLE ...") to reverse schema update | ||
file, err := ioutil.ReadFile("../scripts/20220301_194850_ajuste_tabla_reintegro.down.sql") | ||
|
||
if err != nil { | ||
// handle error | ||
fmt.Println(err) | ||
} | ||
|
||
requests := strings.Split(string(file), ";") | ||
|
||
for _, request := range requests { | ||
fmt.Println(request) | ||
m.SQL(request) | ||
// do whatever you need with result and error | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
database/scripts/20220301_194850_ajuste_tabla_reintegro.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE inscripcion.reintegro DROP COLUMN ultimo_semestre_cursado; |
3 changes: 3 additions & 0 deletions
3
database/scripts/20220301_194850_ajuste_tabla_reintegro.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER TABLE inscripcion.reintegro ADD COLUMN ultimo_semestre_cursado NUMERIC(5,0) NULL; | ||
-- ddl-end -- | ||
COMMENT ON COLUMN inscripcion.reintegro.ultimo_semestre_cursado IS 'Último semestre cursado por el estudiante de la carreara de la que proviene.'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.