- deploy/postgres (package dbassets) embeds the full goose chain; RunMigrations prefers the on-disk dir (dev behavior unchanged) and falls back to the embedded FS when the source tree is absent (single-binary deployments per plan U10/KTD16) - goose SetBaseFS global state reset after use - TestRunMigrationsEmbeddedFallback verified against a throwaway isolated pgvector container: nonexistent dir -> embedded chain -> version 78, migration gate count agrees
15 lines
524 B
Go
15 lines
524 B
Go
// Package dbassets 内嵌数据库迁移链(U10a:单文件应用无源码目录时回退使用)。
|
|
// 磁盘目录存在时仍优先磁盘(开发态行为不变);磁盘与嵌入的一致性由
|
|
// 迁移门禁测试(ExpectedMigrationCount)约束。
|
|
package dbassets
|
|
|
|
import "embed"
|
|
|
|
// MigrationsFS 内嵌 deploy/postgres/goose 迁移链。
|
|
//
|
|
//go:embed all:goose
|
|
var MigrationsFS embed.FS
|
|
|
|
// MigrationsDir 是嵌入 FS 内的迁移子目录名(goose SetBaseFS 的根)。
|
|
const MigrationsDir = "goose"
|