fix: create parent folders when creating schema file

This commit is contained in:
Alexander Navarro 2025-01-27 15:38:15 -03:00
parent b93f037017
commit 6ac6c2c178
4 changed files with 122 additions and 24 deletions

110
examples/schema.toml Normal file
View file

@ -0,0 +1,110 @@
[public.entry_categories]
display_name = "Entry Categories"
[[public.entry_categories.columns]]
name = "entry_id"
type = "Integer"
not_null = true
reference = { table = "entries", identity = "id", label = "Entry Id" }
[[public.entry_categories.columns]]
name = "entry_date"
type = "Date"
not_null = true
reference = { table = "entries", identity = "id", label = "Entry Id" }
[[public.entry_categories.columns]]
name = "category_id"
type = "Integer"
not_null = true
reference = { table = "categories", identity = "id", label = "Category Id" }
[public.sources]
display_name = "Sources"
[[public.sources.columns]]
name = "id"
type = "Integer"
default = "nextval('sources_id_seq'::regclass)"
not_null = true
[[public.sources.columns]]
name = "name"
not_null = true
type = { Varchar = { length = 20 } }
[[public.sources.columns]]
name = "uid"
not_null = true
type = { Varchar = { length = 8 } }
[[public.sources.columns]]
name = "uri"
not_null = true
type = { Varchar = {} }
[[public.sources.columns]]
name = "created_at"
default = "CURRENT_TIMESTAMP"
not_null = true
type = { TimestampWithTimeZone = { precision = 6 } }
[[public.sources.columns]]
name = "updated_at"
not_null = false
type = { TimestampWithTimeZone = { precision = 6 } }
[[public.sources.columns]]
name = "deleted_at"
not_null = false
type = { TimestampWithTimeZone = { precision = 6 } }
[public.categories]
display_name = "Categories"
[[public.categories.columns]]
name = "id"
type = "Integer"
default = "nextval('category_id_seq'::regclass)"
not_null = true
[[public.categories.columns]]
name = "name"
not_null = true
type = { Varchar = { length = 20 } }
[[public.categories.columns]]
name = "uid"
not_null = false
type = { Varchar = { length = 8 } }
[public.entries]
display_name = "Entries"
[[public.entries.columns]]
name = "id"
type = "Integer"
default = "nextval('entries_id_seq'::regclass)"
not_null = true
[[public.entries.columns]]
name = "date"
type = "Date"
default = "CURRENT_TIMESTAMP"
not_null = true
[[public.entries.columns]]
name = "source_id"
type = "Integer"
not_null = true
reference = { table = "sources", identity = "id", label = "Source Id" }
[[public.entries.columns]]
name = "uid"
not_null = true
type = { Varchar = {} }
[[public.entries.columns]]
name = "text"
type = "Text"
not_null = false