Files
Torben Sorensen 1d0bd630b2
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 48s
test, more id fixes, and naming all files
2025-11-25 05:59:56 -08:00

33 lines
1.1 KiB
Bash

#!/bin/bash
# sql/helper_scripts/generate_rollup.sh
# ============================================================================
# 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."