mirror of
https://github.com/zadam/trilium.git
synced 2025-12-14 03:14:24 +01:00
chore(regroup): adapt export-schema script
This commit is contained in:
parent
4a749f52e9
commit
81bc85b8e4
@ -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"
|
|
||||||
14
apps/server/scripts/export-schema.sh
Executable file
14
apps/server/scripts/export-schema.sh
Executable file
@ -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"
|
||||||
Loading…
x
Reference in New Issue
Block a user