MCPcopy Index your code
hub / github.com/dnote/dnote / writeSchema

Function writeSchema

pkg/cli/migrate/legacy.go:244–256  ·  view source on GitHub ↗
(ctx context.DnoteCtx, s schema)

Source from the content-addressed store, hash-verified

242}
243
244func writeSchema(ctx context.DnoteCtx, s schema) error {
245 path := getSchemaPath(ctx)
246 d, err := yaml.Marshal(&s)
247 if err != nil {
248 return errors.Wrap(err, "Failed to marshal schema into yaml")
249 }
250
251 if err := os.WriteFile(path, d, 0644); err != nil {
252 return errors.Wrap(err, "Failed to write schema file")
253 }
254
255 return nil
256}
257
258func getUnrunMigrations(ctx context.DnoteCtx) ([]int, error) {
259 var ret []int

Callers 1

updateSchemaVersionFunction · 0.85

Calls 1

getSchemaPathFunction · 0.85

Tested by

no test coverage detected