Blogs listing + Categories

This commit is contained in:
cdricms
2025-02-25 00:13:53 +01:00
parent ae228710e1
commit 793e3748f9
21 changed files with 695 additions and 192 deletions

View File

@@ -0,0 +1,24 @@
package migrations
import (
"context"
"fmt"
"fr.latosa-escrima/core/models"
"github.com/uptrace/bun"
)
func init() {
Migrations.MustRegister(func(ctx context.Context, db *bun.DB) error {
fmt.Print(" [up migration] ")
_, err := db.
NewAddColumn().
Model((*models.Blog)(nil)).
ColumnExpr("category TEXT").
Exec(ctx)
return err
}, func(ctx context.Context, db *bun.DB) error {
fmt.Print(" [down migration] ")
return nil
})
}