about summary refs log tree commit diff stats
path: root/scripts/mkdb.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/mkdb.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/mkdb.sh b/scripts/mkdb.sh
index 6bcebaf..f0c7740 100755
--- a/scripts/mkdb.sh
+++ b/scripts/mkdb.sh
@@ -16,9 +16,14 @@ db="$root/target/database.sqlx"
 [ -f "$db" ] && rm "$db"
 [ -d "$root/target" ] || mkdir "$root/target"
 
-fd . "$root/yt/src/storage/migrate/sql" | while read -r sql_file; do
+fd . "$root/crates/yt/src/storage/migrate/sql" | while read -r sql_file; do
     echo "Applying sql migration file: $(basename "$sql_file").."
-    sqlite3 "$db" <"$sql_file"
+    {
+        # NOTE(@bpeetz): The wrapping in a transaction is needed to simulate the rust code. <2025-05-07>
+        echo "BEGIN TRANSACTION;"
+        cat "$sql_file"
+        echo "COMMIT TRANSACTION;"
+    } | sqlite3 "$db"
 done
 
 # vim: ft=sh