Releases: robinNcode/lara-db-craft
fix: correct syntax generation for column types with parameters
- Fix CHAR column type generation syntax
- Fix VARCHAR column type generation syntax
- Fix DECIMAL column type generation with precision and scale
Previously, the mapToLaravelType() method was returning malformed
strings like 'char, 10' which resulted in invalid migration syntax:
$table->char, 10('column_name');
This commit refactors the method to return an array structure
containing the method name and parameters separately, allowing
proper syntax generation:
$table->char('column_name', 10);
$table->string('column_name', 255);
$table->decimal('column_name', 8, 2);
Changes:
- Refactored mapToLaravelType() to return ['method' => '...', 'length' => '...']
- Updated getColumnDefinition() to handle new array structure
- Added proper parameter formatting for decimal types (precision, scale)
Tested with MySQL CHAR(10), VARCHAR(255), DECIMAL(8,2) columns"
Seeder chunk size updated
update: seeder chunk size and some documentaion
Minor bug fixes
fix: migration generation class and some documentations.
What's Changed
- fix: migration generation class and some documentations. by @robinNcode in #2
Full Changelog: v1.0.0...v1.0.1
First release
✨ Automatic Migration Generation: Generate Laravel migration files from existing database tables.
🔄 Seeder Generation: Create seeders with actual table data.
🎯 Table-Specific Generation: Generate for all tables or specific ones.
🗄️ Multi-Database Support: Works with MySQL, PostgreSQL, and SQLite.
🔗 Foreign Key Detection: Automatically detects and includes foreign key constraints.
📊 Index Support: Preserves indexes and unique constraints.
⚙️ Configurable: Exclude tables, customize paths, and more.
🚀 Easy to Use: Simple artisan commands.