Skip to content

Commit

Permalink
feat: ajuste en tabla de reingreso. udistrital/sga_cliente#860
Browse files Browse the repository at this point in the history
  • Loading branch information
JQuinteroC committed Mar 2, 2022
1 parent 0727bea commit a3776d0
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
60 changes: 60 additions & 0 deletions database/migrations/20220301_194850_ajuste_tabla_reintegro.go
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
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE inscripcion.reintegro DROP COLUMN ultimo_semestre_cursado;
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.';
Binary file modified inscripcion_V_17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a3776d0

Please sign in to comment.