Files
sm-bm-plugin/updates/20261002121227_add_elective_group_to_courses.go
Jakub Zych 1046237771 feat: add the study data models and schema migrations
Courses, meetings, class sessions, deadlines, readings with per-user
progress, materials with tags and file attachments. Timestamps are
stored in UTC and held as Europe/Warsaw text so the admin text inputs
can write them.
2026-10-02 14:26:08 +02:00

23 lines
730 B
Go

// Code generated by summer make. DO NOT EDIT.
package updates
import (
"github.com/go-gormigrate/gormigrate/v2"
"gorm.io/gorm"
)
// AddElectiveGroupToCourses returns the 20261002121227_add_elective_group_to_courses gormigrate entry:
// courses that share an elective_group are alternatives ("do wyboru").
func AddElectiveGroupToCourses() *gormigrate.Migration {
return &gormigrate.Migration{
ID: "20261002121227_add_elective_group_to_courses",
Migrate: func(tx *gorm.DB) error {
return tx.Exec("ALTER TABLE jz_bm_courses ADD COLUMN elective_group VARCHAR(100) NULL").Error
},
Rollback: func(tx *gorm.DB) error {
return tx.Exec("ALTER TABLE jz_bm_courses DROP COLUMN IF EXISTS elective_group").Error
},
}
}