fix migrations 6

This commit is contained in:
2026-06-11 13:59:28 +03:30
parent f342be2881
commit 241406301e
2 changed files with 33 additions and 0 deletions
+9
View File
@@ -23,11 +23,17 @@ DB_PASSWORD=$(grep ^DB_PASSWORD= .env | cut -d= -f2- | tr -d '\r"')
# ۱ baseline
mysql -h "$DB_HOST" -P "$DB_PORT" -u "$DB_USERNAME" -p"$DB_PASSWORD" "$DB_DATABASE" \
< database/sql/baseline_migrations.sql
#mysql -h 127.0.0.1 -P 3030 -u root -p soroushgold < database/sql/baseline_migrations.sql
# باید ۱۱ ردیف چاپ شود (شامل 2019 و 2021)
# ۲ چک DB — اگر کمتر از ۲ بود baseline قدیمی است
mysql -h "$DB_HOST" -P "$DB_PORT" -u "$DB_USERNAME" -p"$DB_PASSWORD" "$DB_DATABASE" -N -e \
"SELECT COUNT(*) FROM migrations WHERE migration LIKE '2019%' OR migration LIKE '2021%';"
#mysql -h "127.0.0.1" -P "3030" -u "root" -p"1ipqLRRMC7qS8s3WkuwXiS7P" "soroushgold" -N -e \"SELECT COUNT(*) FROM migrations WHERE migration LIKE '2019%' OR migration LIKE '2021%';"
# باید: 2
# ۳ status — ۱۰ تا همه Yes
@@ -39,6 +45,8 @@ php artisan migrate
# ۵ settings
mysql -h "$DB_HOST" -P "$DB_PORT" -u "$DB_USERNAME" -p"$DB_PASSWORD" "$DB_DATABASE" \
< database/sql/deploy_settings_const.sql
#mysql -h "127.0.0.1" -P "3030" -u "root" -p"1ipqLRRMC7qS8s3WkuwXiS7P" "soroushgold" \ < database/sql/deploy_settings_const.sql
```
**یا:** `bash database/sql/run_deploy_existing_db.sh`
@@ -95,6 +103,7 @@ mysql ... < database/sql/deploy_settings_const.sql
| `Loading stored database schema` | restore بکاپ → `baseline` قبل از `migrate` |
| `2019`/`2021` No بعد از baseline | baseline قدیمی → `fake_package_migrations.sql` |
| `Unknown host HOST` | از `.env` بخوان نه placeholder |
| `Unknown column 'is_exist'` | `git pull` + دوباره `deploy_settings_const.sql` (نسخه جدید ستون را اضافه می‌کند) |
---