-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdb_seed.sh
More file actions
executable file
·35 lines (30 loc) · 1.04 KB
/
Copy pathdb_seed.sh
File metadata and controls
executable file
·35 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# db_seed.sh - Initialisiert das Schema und importiert die Demo-Daten
# Part of KAiOSS Demo Setup | NixOS compatible
NS=${VITE_SURREAL_NS:-demo}
DB=${VITE_SURREAL_DB:-demo}
echo "🧹 Initialisiere Schema im Namespace '$NS'..."
curl -s -X POST \
-u "root:root" \
-H "Accept: application/json" \
-H "Surreal-NS: $NS" \
-H "Surreal-DB: $DB" \
--data-binary "@db/init_clean.surql" \
"http://localhost:8000/sql" > /dev/null
echo "🌱 Importiere Demo-Daten in Namespace '$NS'..."
curl -s -X POST \
-u "root:root" \
-H "Accept: application/json" \
-H "Surreal-NS: $NS" \
-H "Surreal-DB: $DB" \
--data-binary "@db/seed.surql" \
"http://localhost:8000/sql" > /dev/null
echo "🌱 Importiere Roadmap Demo-Daten in Namespace '$NS'..."
curl -s -X POST \
-u "root:root" \
-H "Accept: application/json" \
-H "Surreal-NS: $NS" \
-H "Surreal-DB: $DB" \
--data-binary "@db/roadmap_seed.surql" \
"http://localhost:8000/sql" > /dev/null
echo "✅ Demo-Daten erfolgreich in '$NS' geladen!"