mysql - Is there any best way to migrate existing tables without foreign keys to Laravel 5 with Eloquent? -
i testing laravel 5.2 mariadb 10.0, , love framework. migrate part of existing web app (custom accounting web application) laravel 5.2. there issues migrate current web application laravel.
(1) current database doesn't use foreign key read laravel manual, use eloquent orm( not query builder), using foreign key mandatory far understand. existing database doesn't use foreign key @ all.
(2) current database structure doesn't fit laravel understand laravel requrired own styled table structure although allow overriding not everything. review database, needs lot of modification fit laravel style.
in summary, want migrating of existing tables , develope laravel web application using eloquent, not query builder.
i looking forward great opinions , advices.
(1) that's not true. using foreign keys not mandatory. relationships loaded using convention rules, has point 2. although using them recommended. screwed apps because foreign keys not created in mysql because default engine didn't support them. didn't notice until late.
(2) laravel convention on configuration, means, works better if db matches laravel conventions. however, don't understand why not running migrations? unused tables can still live in database. don't use them in laravel.
Comments
Post a Comment