Files
flyer-crawler.projectium.com/sql/generate_rollup.ps1
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.2 KiB
PowerShell

<#
.SYNOPSIS
SQL ROLLUP GENERATION SCRIPT (POWERSHELL)
.DESCRIPTION
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.
.EXAMPLE
From the root of the project, run:
.\sql\generate_rollup.ps1
#>
# Set the script to stop on errors
$ErrorActionPreference = "Stop"
# Define file paths relative to the script's location
$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$ProjectRoot = Resolve-Path -Path (Join-Path $PSScriptRoot "..")
$MasterFile = Join-Path $ProjectRoot "sql\master_schema_rollup.sql"
# The individual files to concatenate, IN ORDER.
$SourceFiles = @(
(Join-Path $ProjectRoot "sql\initial_schema.sql"),
(Join-Path $ProjectRoot "sql\initial_data.sql"),
(Join-Path $ProjectRoot "sql\initial_triggers_and_functions.sql")
)
Write-Host "Generating '$MasterFile' from source files..."
Get-Content -Path $SourceFiles | Set-Content -Path $MasterFile -Encoding UTF8
Write-Host "✅ Success: '$MasterFile' has been generated." -ForegroundColor Green