about summary refs log tree commit diff stats
path: root/scripts/mkdb.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mkdb.sh')
-rwxr-xr-xscripts/mkdb.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/mkdb.sh b/scripts/mkdb.sh
index 9ce5dd8..6bcebaf 100755
--- a/scripts/mkdb.sh
+++ b/scripts/mkdb.sh
@@ -11,11 +11,14 @@
 # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
 root="$(dirname "$0")/.."
-db="$root/target/database.sqlite"
+db="$root/target/database.sqlx"
 
 [ -f "$db" ] && rm "$db"
 [ -d "$root/target" ] || mkdir "$root/target"
 
-sqlite3 "$db" <"$root/yt/src/storage/video_database/schema.sql"
+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"
+done
 
 # vim: ft=sh