- Update backend/.env: DB_DATABASE=xserver
- Update backend/.env.example: DB_DATABASE=xserver
- Update docker-compose.yml: DB_DATABASE=xserver
- Update backend/app/util/Db.php: default database=xserver
The old database name 'x_server_mobile' has been fully migrated to 'xserver'.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 008_complete_init.sql with all 10 tables
- Include approval workflow tables:
- approval_flow (审批流程配置表)
- approval_node (审批流程节点表)
- approval_order (审批单表)
- approval_record (审批记录表)
- Include business trip tables:
- business_trip (出差申请表)
- business_trip_itinerary (出差行程明细表)
- Include user_feishu_binding (用户飞书应用绑定表)
All tables use proper UTF-8 encoding with utf8mb4_unicode_ci collation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change default database from x_server_mobile to xserver
- Add 007_xserver_init.sql initialization script
- Companies data now correctly encoded in UTF-8:
- 合塑 (hesu)
- 新友合 (xinyouhe)
- 派卡 (paika)
- 斯玛特 (simate)
- magic bridge Auto (mbaf)
- Company Feishu apps properly configured
The key fix is to execute SQL directly inside the MySQL container
using heredoc to avoid charset conversion issues during transfer.
Usage:
docker exec 1Panel-mysql-409s mysql -uroot -p'mysql_xEsdPa' --default-character-set=utf8mb4 xserver < 007_xserver_init.sql
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 006_fix_encoding_utf8.sql migration script
- Properly sets UTF-8 charset for table creation
- Recreates companies and users tables with correct Chinese comments
- Imports company data with correct UTF-8 encoding
Usage:
docker exec -i 1Panel-mysql-409s mysql -uroot -p'mysql_xEsdPa' --default-character-set=utf8mb4 x_server_mobile < 006_fix_encoding_utf8.sql
Fixes encoding issues where Chinese text appears as garbled characters
due to MySQL client using latin1 charset instead of utf8mb4.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update .gitignore to allow backend database migrations
- Add 004_fix_table_structure.sql migration
- Rename tables to plural form (user->users, company->companies)
- Add missing fields to companies and users tables
- Create company_feishu_apps table for multi-app configuration
- Import company data and Feishu app configurations
- Set UTF-8 charset to fix encoding issues from MySQL 5.7 export
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove 002_merge_old_data.sql (complex approach with temp tables)
- Keep 003_import_feishu_config.sql (simplified data import)
Follows principle: only import needed data, not full compatibility.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update .gitignore to exclude large SQL files except migrations
- Add GIT_WORKFLOW.md documenting branch strategy
- Update Company model with Feishu app retrieval methods
- Update User model with Feishu-related scopes
- Update FeishuService to support multi-app configuration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add companies table enhancements (abbr, tenant_key, feishu_enabled)
- Add users table enhancements (feishu fields, sn, report_to, etc.)
- Create company_feishu_apps table for multi-app per company
- Create user_sn_pool table for user number management
- Update FeishuService to support multiple Feishu apps per company
- Add data migration script (002_merge_old_data.sql)
- Add import script (scripts/import_old_data.php)
- Update User and Company models with new scopes and relationships
- Add CompanyFeishuApp model
- Add Git workflow documentation (GIT_WORKFLOW.md)
This supports:
- Multi-company architecture with Feishu integration
- Multiple Feishu apps per company (X-Server, Ticket, CRM)
- User number assignment system
- Data migration from old project
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>