Files
flyer-crawler.projectium.com/sql/generate_rollup.sh
Torben Sorensen 59ace9b31e
Some checks are pending
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Has started running
final initial database fixes - IT WORKS
2025-11-21 18:48:17 -08:00

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."