Some checks are pending
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Has started running
33 lines
1.1 KiB
Bash
33 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
# ============================================================================
|
|
# SQL ROLLUP GENERATION SCRIPT (BASH)
|
|
# ============================================================================
|
|
# Purpose:
|
|
# This script automatically generates the 'master_schema_rollup.sql' file by
|
|
# concatenating the individual SQL component files in the correct order.
|
|
#
|
|
# WARNING: This will overwrite the existing master_schema_rollup.sql file.
|
|
#
|
|
# Usage:
|
|
# From the root of the project, run:
|
|
# bash sql/generate_rollup.sh
|
|
# ============================================================================
|
|
|
|
# Set the script to exit immediately if a command fails
|
|
set -e
|
|
|
|
# Define file paths relative to the project root
|
|
SQL_DIR="sql"
|
|
MASTER_FILE="$SQL_DIR/master_schema_rollup.sql"
|
|
|
|
# The individual files to concatenate, IN ORDER.
|
|
SOURCE_FILES=(
|
|
"$SQL_DIR/initial_schema.sql"
|
|
"$SQL_DIR/initial_data.sql"
|
|
"$SQL_DIR/initial_triggers_and_functions.sql"
|
|
)
|
|
|
|
echo "Generating '$MASTER_FILE' from source files..."
|
|
cat "${SOURCE_FILES[@]}" > "$MASTER_FILE"
|
|
echo "✅ Success: '$MASTER_FILE' has been generated." |