Monthly Update - 2025-09
This month's updates bring important MySQL schema management improvements, including automatic foreign key generation and alter column fixes.
Changesโ
teaql-spring-boot-starterโ
๐ Add MySQL FK generation when ensuring tablesโ
TeaQL now automatically generates foreign key constraints when ensuring database tables. When ensureTables runs, MySQL repositories will detect entity relationships defined in the domain model and create the corresponding FOREIGN KEY constraints in the database schema.
+ MysqlRepository: added FK generation logic to ensureTables()
+ Automatically creates FK constraints based on domain model relationships
This means you no longer need to manually manage foreign key relationships in your MySQL database โ TeaQL handles it for you based on your model definitions.
๐ Fix MySQL ALTER issueโ
Fixed an issue with the MySQL ALTER TABLE statement generation. The alter column logic was incorrectly constructing DDL statements, which could cause schema migration failures.
+ MysqlRepository: corrected ALTER TABLE column modification logic
+ Resolved edge cases in column type changes and nullability updates
Technical Details
The ensureTables process now follows this order:
- Create missing tables
- Add missing columns
- Generate foreign keys (new)
- Fix column type mismatches
This ensures FK constraints reference columns that already exist.
