Fix: 1. Save proc architecture update for records saved with subrecords / linked records, such as Order has Items. \n 2. Style improvements for Product Category, Product, Product Permutation pages.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:: set "test=C:\C:\ \"
|
||||
set dir_parent=C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\static\MySQL
|
||||
:: set dir_parent=C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\static\PostgreSQL
|
||||
set "f_list=file_list.txt"
|
||||
@@ -19,14 +18,12 @@ set "strs_delete_6=600_p_shop_save_product.sql"
|
||||
set "strs_delete_7=170_ish_tbl_ERP_Order.sql"
|
||||
set "strs_delete_7=dump.sql"
|
||||
set strs_n_max=8
|
||||
set strs_list =%strs_delete_0% %strs_delete_1% %strs_delete_2% %strs_delete_3% %strs_delete_4%
|
||||
set "str_true=true"
|
||||
set "str_replace="
|
||||
|
||||
set "str_list="
|
||||
|
||||
set max_length=8191
|
||||
set threshold=1000
|
||||
|
||||
:: report constants
|
||||
echo temp = %f_tmp%
|
||||
echo dir_parent = !%dir_parent%!
|
||||
echo dir_current = !%dir_current%!
|
||||
@@ -34,49 +31,43 @@ echo file_list = %f_list%
|
||||
echo file = %f_combine%
|
||||
echo n strings = !strs_n_max!
|
||||
|
||||
:: begin
|
||||
cd %dir_parent%
|
||||
::echo current directory: %cd%
|
||||
del %f_tmp%
|
||||
del %f_list%
|
||||
del %f_combine%
|
||||
|
||||
:: colate dir files
|
||||
dir /b > %f_list%
|
||||
dir /b *.sql > %f_list%
|
||||
|
||||
::type %f_list%
|
||||
|
||||
echo loopy
|
||||
:: Remove blacklist files
|
||||
:: grep -v '920_edit_permissions.sql' %f_list% > %f_list%
|
||||
:: grep -v '910_anal.sql' %f_list% > %f_list%
|
||||
|
||||
|
||||
(for /f "delims=" %%a in (%f_list%) do (
|
||||
::if %verbose% gtr 0 ( echo new line )
|
||||
set "line=%%a"
|
||||
::if %verbose% gtr 0 ( echo new line = !line! )
|
||||
::if !line! neq %strs_delete_0% if !line! neq %strs_delete_1% if !line! neq %strs_delete_2% if !line! neq %strs_delete_3% if !line! neq %strs_delete_4% if !line! neq %strs_delete_5% if !line! neq %strs_delete_6% (
|
||||
:: echo !line!
|
||||
:: set "str_list=!str_list! !line!"
|
||||
::)
|
||||
set include_line=1
|
||||
for /L %%i in (0, 1, %strs_n_max%) do (
|
||||
::set "str_delete=!strs_delete_%%i!"
|
||||
if !line! equ !strs_delete_%%i! (
|
||||
set include_line=0
|
||||
)
|
||||
::set "include_line=!include_line!"
|
||||
set "line=!line!"
|
||||
)
|
||||
if !include_line! gtr 0 (
|
||||
echo !line!
|
||||
set "str_list=!str_list! !line!"
|
||||
::set "str_list=!str_list! !line!"
|
||||
::set length=0
|
||||
::for %%i in (!str_list!) do (
|
||||
:: set /a length+=1
|
||||
::)
|
||||
::if !length! geq !threshold! (
|
||||
:: echo !str_list!
|
||||
:: echo !str_list! > %f_combine%
|
||||
:: set "str_list="
|
||||
::)
|
||||
type !line! >> %f_combine%
|
||||
)
|
||||
set "line=!line!"
|
||||
)) > %f_tmp%
|
||||
|
||||
:: Combine files
|
||||
|
||||
echo output list:
|
||||
type %f_tmp%
|
||||
|
||||
@@ -84,12 +75,15 @@ del %f_list%
|
||||
echo file_tmp: %f_tmp%
|
||||
echo file_list: %f_list%
|
||||
echo combining files
|
||||
::type %f_tmp% | type > %f_list%
|
||||
::
|
||||
::type %f_list%
|
||||
echo !str_list!
|
||||
|
||||
echo cmd:
|
||||
echo "type !str_list! > %f_combine%"
|
||||
type !str_list! > %f_combine%
|
||||
::echo "type !str_list! > %f_combine%"
|
||||
::type !str_list! > %f_combine%
|
||||
::(for %%f in (!str_list!) do (
|
||||
:: echo %%f
|
||||
:: type "%%f" >> %f_combine%
|
||||
::))
|
||||
|
||||
cd %dir_current%
|
||||
|
||||
|
||||
43
static/batch/sql_combine.ps1
Normal file
43
static/batch/sql_combine.ps1
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
# Combine-SqlFiles.ps1
|
||||
param(
|
||||
[string]$sourceFolder = "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\static\MySQL\",
|
||||
[string]$outputFileName = "0000_combined.sql",
|
||||
[string]$filePattern = "*.sql",
|
||||
[string[]]$excludeFiles = @("920_edit_permissions.sql", "910_anal.sql", "701_p_shop_get_many_role_permission.sql", "600_p_shop_save_product.sql", "dump.sql") # Array of filenames to exclude
|
||||
)
|
||||
|
||||
$outputFile = Join-Path $sourceFolder $outputFileName
|
||||
$outputDir = Split-Path -Parent $outputFile
|
||||
|
||||
# Remove output file if it exists
|
||||
if (Test-Path $outputFile) {
|
||||
Remove-Item $outputFile -Force
|
||||
}
|
||||
|
||||
# Create directory if needed
|
||||
if (!(Test-Path -Path $outputDir)) {
|
||||
New-Item -ItemType Directory -Force -Path $outputDir
|
||||
}
|
||||
|
||||
# Create a StringBuilder for efficiency
|
||||
$output = New-Object System.Text.StringBuilder
|
||||
|
||||
# Process each file
|
||||
Get-ChildItem -Path $sourceFolder -Filter $filePattern -File |
|
||||
Where-Object { $_.Name -notin $excludeFiles -and $_.Name -ne $outputFileName } |
|
||||
ForEach-Object {
|
||||
[void]$output.AppendLine("-- File: $($_.Name)")
|
||||
# Read file content and remove BOM if present
|
||||
$content = [System.IO.File]::ReadAllBytes($_.FullName)
|
||||
if ($content[0] -eq 0xEF -and $content[1] -eq 0xBB -and $content[2] -eq 0xBF) {
|
||||
$content = $content[3..($content.Length-1)]
|
||||
}
|
||||
[void]$output.AppendLine([System.Text.Encoding]::UTF8.GetString($content))
|
||||
[void]$output.AppendLine()
|
||||
}
|
||||
|
||||
# Write final output
|
||||
[System.IO.File]::WriteAllText($outputFile, $output.ToString(), [System.Text.UTF8Encoding]::new($false))
|
||||
|
||||
Write-Host "Files combined successfully into $outputFile"
|
||||
Reference in New Issue
Block a user