mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-12 13:10:05 +00:00

- Add MySQL database support with environment-based configuration - Fix MySQL compatibility issue with 'key' column name - Maintain SQLite as default database - Add proper validation for MySQL configuration - Test and verify compatibility with existing database - Replaced raw SQL queries using JSON_EACH functions with standard GORM queries - Modified functions to handle JSON parsing in Go code instead of database since JSON_EACH is not available on MySQL or MariaDB: - getAllEmails() - GetClientTrafficByID() - getFallbackMaster() - MigrationRemoveOrphanedTraffics() The system now supports both MySQL and SQLite databases, with SQLite remaining as the default option. MySQL connection is only used when explicitly configured through environment variables.
8 lines
No EOL
138 B
Text
8 lines
No EOL
138 B
Text
DB_CONNECTION=sqlite
|
|
|
|
# If DB connection is "mysql"
|
|
# DB_HOST=127.0.0.1
|
|
# DB_PORT=3306
|
|
# DB_DATABASE=xui
|
|
# DB_USERNAME=root
|
|
# DB_PASSWORD= |