quintodrome/db/migrations/20210601231734_update_share_fieldnames.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
554 B
Go
Raw Normal View History

package migrations
import (
2023-11-27 10:46:44 -09:00
"context"
"database/sql"
2023-04-04 05:57:00 -08:00
"github.com/pressly/goose/v3"
)
func init() {
2023-11-27 10:46:44 -09:00
goose.AddMigrationContext(upUpdateShareFieldNames, downUpdateShareFieldNames)
}
2023-11-27 10:46:44 -09:00
func upUpdateShareFieldNames(_ context.Context, tx *sql.Tx) error {
_, err := tx.Exec(`
alter table share rename column expires to expires_at;
alter table share rename column created to created_at;
alter table share rename column last_visited to last_visited_at;
`)
return err
}
2023-11-27 10:46:44 -09:00
func downUpdateShareFieldNames(_ context.Context, tx *sql.Tx) error {
return nil
}