/
home
/
u694682534
/
domains
/
blackbooks.me
/
public_html
/
amer
/
Upload File
HOME
@echo off REM ============================================ REM BlackBooks Lite - Cost Centers Migrations REM ============================================ REM This script runs all migrations related to Cost Centers REM Created: 2025-02-01 REM ============================================ echo. echo ============================================ echo BlackBooks Lite - Cost Centers Migrations echo ============================================ echo. REM Change to the project directory cd /d "%~dp0BlackBooks_lite" REM Check if artisan exists if not exist "artisan" ( echo ERROR: artisan file not found! echo Please make sure you're running this script from the Laravel project root. pause exit /b 1 ) REM Set PHP path set PHP_PATH=C:\laragon\bin\php\php-8.3.26-Win32-vs16-x64\php.exe REM Check if PHP exists if not exist "%PHP_PATH%" ( echo ERROR: PHP not found at: %PHP_PATH% echo Please update the PHP_PATH in this script. pause exit /b 1 ) echo PHP Path: %PHP_PATH% echo Project Directory: %CD% echo. echo ============================================ echo Running Cost Centers Migrations... echo ============================================ echo. REM Run cost_centers table migration echo [1/8] Running cost_centers table migration... "%PHP_PATH%" artisan migrate --path=database/migrations/2025_02_01_100001_create_cost_centers_table.php --force if errorlevel 1 ( echo WARNING: Cost centers migration failed or already exists. Continuing... ) echo. REM Run cost_center_settings table migration echo [2/8] Running cost_center_settings table migration... "%PHP_PATH%" artisan migrate --path=database/migrations/2025_02_01_100002_create_cost_center_settings_table.php --force if errorlevel 1 ( echo WARNING: Cost center settings migration failed or already exists. Continuing... ) echo. REM Run add cost_center_id to transactions table echo [3/8] Adding cost_center_id to transactions table... "%PHP_PATH%" artisan migrate --path=database/migrations/2025_02_01_100003_add_cost_center_id_to_transactions_table.php --force if errorlevel 1 ( echo WARNING: Add cost_center_id to transactions migration failed or already exists. Continuing... ) echo. REM Run add cost_center_id to transaction_expense_lines table echo [4/8] Adding cost_center_id to transaction_expense_lines table... "%PHP_PATH%" artisan migrate --path=database/migrations/2025_02_01_100004_add_cost_center_id_to_transaction_expense_lines_table.php --force if errorlevel 1 ( echo WARNING: Add cost_center_id to transaction_expense_lines migration failed or already exists. Continuing... ) echo. REM Run add cost_center_id to transaction_payments table echo [5/8] Adding cost_center_id to transaction_payments table... "%PHP_PATH%" artisan migrate --path=database/migrations/2025_02_01_100005_add_cost_center_id_to_transaction_payments_table.php --force if errorlevel 1 ( echo WARNING: Add cost_center_id to transaction_payments migration failed or already exists. Continuing... ) echo. REM Run add cost_center_id to cheques table echo [6/8] Adding cost_center_id to cheques table... "%PHP_PATH%" artisan migrate --path=database/migrations/2025_02_01_100006_add_cost_center_id_to_cheques_table.php --force if errorlevel 1 ( echo WARNING: Add cost_center_id to cheques migration failed or already exists. Continuing... ) echo. REM Run add cost_center_id to account_transactions table echo [7/8] Adding cost_center_id to account_transactions table... "%PHP_PATH%" artisan migrate --path=database/migrations/2025_02_01_100007_add_cost_center_id_to_account_transactions_table.php --force if errorlevel 1 ( echo WARNING: Add cost_center_id to account_transactions migration failed or already exists. Continuing... ) echo. REM Run add foreign key cost_center to journal_entries echo [8/8] Adding foreign key cost_center to journal_entries... "%PHP_PATH%" artisan migrate --path=database/migrations/2025_02_01_100008_add_foreign_key_cost_center_to_journal_entries.php --force if errorlevel 1 ( echo WARNING: Add foreign key cost_center to journal_entries migration failed or already exists. Continuing... ) echo. echo ============================================ echo Migration process completed! echo ============================================ echo. echo Note: If you see warnings above, the migrations may have already been run. echo This is normal if the tables already exist. echo. pause