about summary refs log tree commit diff stats
path: root/scripts/mkdb.sh
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-13 21:03:55 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-13 21:03:55 +0200
commit7694496efa621466e327b9c00fe1c5cc092ccc1f (patch)
treeb5abcd15e00999f92ea4632bdbda3410a849505b /scripts/mkdb.sh
parentfix(yt/storage/migrate): Correctly state the upgrade to the topmost version (diff)
downloadyt-7694496efa621466e327b9c00fe1c5cc092ccc1f.zip
fix(yt/storage/migrate): Correct the two to three migration script
Diffstat (limited to '')
-rwxr-xr-xscripts/mkdb.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/mkdb.sh b/scripts/mkdb.sh
index 6bcebaf..a6b453c 100755
--- a/scripts/mkdb.sh
+++ b/scripts/mkdb.sh
@@ -18,7 +18,12 @@ db="$root/target/database.sqlx"
 
 fd . "$root/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