mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 13:31:17 +00:00
- Delete dropIndexIfExists helper from `model/main.go` - Remove all calls to dropIndexIfExists in `migrateDB` and `migrateDBFast` - Drop related comments and MySQL-only DROP INDEX code paths - Keep GORM AutoMigrate as the sole migration path for `Model` and `Vendor` Why: - Simplifies migrations and avoids destructive index drops at startup - Prevents noisy MySQL 1091 errors and vendor-specific branches - Aligns with composite unique indexes (uk_model_name_delete_at, uk_vendor_name_delete_at) Impact: - No expected runtime behavior change; schema remains managed by GORM - Legacy single-column unique indexes (if any) will no longer be auto-dropped - Safe across MySQL/PostgreSQL/SQLite; MySQL Chinese charset checks remain intact Verification: - Lint passed for `model/main.go` - Confirmed no remaining `DROP INDEX` or `dropIndexIfExists` references