Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(regroup): adapt export-schema script
Elian Doran81bc85b8e427
diff --git a/_regroup/bin/export-schema.sh b/_regroup/bin/export-schema.shdeleted file mode 100644index ab5de1a815..0000000000--- a/_regroup/bin/export-schema.sh+++ /dev/null@@ -1,7 +0,0 @@-#!/usr/bin/env bash--SCHEMA_FILE_PATH=db/schema.sql--sqlite3 ./data/document.db .schema | grep -v "sqlite_sequence" > "$SCHEMA_FILE_PATH"--echo "DB schema exported to $SCHEMA_FILE_PATH"\ No newline at end of filediff --git a/apps/server/scripts/export-schema.sh b/apps/server/scripts/export-schema.shnew file mode 100755index 0000000000..c93adee0cd--- /dev/null+++ b/apps/server/scripts/export-schema.sh@@ -0,0 +1,14 @@+#!/usr/bin/env bash++SCRIPT_DIR=$(realpath $(dirname $0))+DB_FILE_PATH="$SCRIPT_DIR/../data/document.db"+SCHEMA_FILE_PATH="$SCRIPT_DIR/../src/assets/db/schema.sql"++if ! command -v sqlite3 &> /dev/null; then+ echo "Missing command: sqlite3"+ exit 1+fi++sqlite3 "$DB_FILE_PATH" .schema | grep -v "sqlite_sequence" > "$SCHEMA_FILE_PATH"++echo "DB schema exported to $SCHEMA_FILE_PATH"\ No newline at end of file