feat: migracion SQL, template DB y generador para fn_operations
001_init.sql como espejo del schema, gentemplate para crear operations.db vacias con schema aplicado, y template lista para copiar con fn ops init.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
ops "fn-registry/fn_operations"
|
||||
)
|
||||
|
||||
func main() {
|
||||
path := "fn_operations/project_template/operations.db"
|
||||
if len(os.Args) > 1 {
|
||||
path = os.Args[1]
|
||||
}
|
||||
|
||||
// Remove existing template
|
||||
os.Remove(path)
|
||||
|
||||
db, err := ops.Open(path)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
fmt.Printf("Template DB created at %s\n", path)
|
||||
}
|
||||
Reference in New Issue
Block a user