feat: add db init

This commit is contained in:
Derrick Hammer 2023-12-24 23:09:12 -05:00
parent 0ca9099d31
commit 5cf0e15e2d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 32 additions and 1 deletions

View File

@ -20,4 +20,10 @@ services:
command: ["npm", "run", "melli-init"]
volumes:
- ./data/app.db:/app/prisma/dev.db
profiles: ["mellisearch_init"]
profiles: ["disabled"]
db_init:
build: .
command: ["npm", "run", "db-init"]
volumes:
- ./data/app.db:/app/prisma/dev.db
profiles: ["disabled"]

View File

@ -0,0 +1,24 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Data.Posts }}
{{- if .Permalink -}}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>
{{- end -}}
{{ end }}
</urlset>

View File

@ -18,6 +18,7 @@
"typecheck": "tsc",
"bridge": "bun run scripts/bridge.mts",
"melli-init": "bun run scripts/melli-init.mts",
"db-init": "prisma db push",
"postinstall": "patch-package"
},
"dependencies": {