- make:admin-controller, make:command and make:migration output, finished: the Posts controller serves models.Post behind acme.blog.access_posts, WinterCMS-style form and list YAML embedded through pact.AdminAssets, blog:publish sets published_at by slug with a bound parameter - the posts route lists published posts only, newest first - Docker tests migrate an ICU pl-PL database, roll back published_at, serve the route and run blog:publish with a published and an opened database - the page gains the admin controller, console command and added-column sections
22 lines
609 B
Go
22 lines
609 B
Go
// Code generated by summer make. DO NOT EDIT.
|
|
|
|
package updates
|
|
|
|
import (
|
|
"github.com/go-gormigrate/gormigrate/v2"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// AddPublishedAt returns the 20260101000100_add_published_at gormigrate entry.
|
|
func AddPublishedAt() *gormigrate.Migration {
|
|
return &gormigrate.Migration{
|
|
ID: "20260101000100_add_published_at",
|
|
Migrate: func(tx *gorm.DB) error {
|
|
return tx.Exec("ALTER TABLE acme_blog_posts ADD COLUMN published_at TIMESTAMPTZ NULL").Error
|
|
},
|
|
Rollback: func(tx *gorm.DB) error {
|
|
return tx.Exec("ALTER TABLE acme_blog_posts DROP COLUMN IF EXISTS published_at").Error
|
|
},
|
|
}
|
|
}
|