21 lines
427 B
Go
21 lines
427 B
Go
// Package migrations embeds the SQL schema so no runtime filesystem access is
|
|||
|
|
// required.
|
||
|
|
package migrations
|
||
|
|
|
||
|
|
import "embed"
|
||
|
|
|
||
|
|
//go:embed *.sql
|
||
|
|
var FS embed.FS
|
||
|
|
|
||
|
|
// SQL returns the migration files in lexical order.
|
||
|
|
func SQL() []string {
|
||
|
|
entries, err := FS.ReadDir(".")
|
||
|
|
if err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
names := make([]string, 0, len(entries))
|
||
|
|
for _, e := range entries {
|
||
|
|
names = append(names, e.Name())
|
||
|
|
}
|
||
|
|
return names
|
||
|
|
}
|