This package provides a simple way to convert your database schema from one database management system to another. It is built on top of the Laravel framework.
You can install the package via composer:
composer require richan-fongdasen/database-converter-laravel
You can publish the configuration file using the following command:
php artisan vendor:publish --provider="RichanFongdasen\DatabaseConverter\DatabaseConverterServiceProvider"
The above command publishes the configuration file to config/database-converter-laravel.php
, and the content of the configuration file will look like this:
return [
'chunk_size' => 700,
];
In this example, we will convert the database schema from MySQL to SQLite.
First, you need to configure the database connection that you want to convert to. You can do this by adding a new database connection configuration in your config/database.php
file.
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => database_path('database.sqlite'),
'prefix' => '',
'foreign_key_constraints' => true,
],
],
Before you can convert the database schema, you need to run the migration on the conversion target database. You can do this by running the following command:
php artisan migrate --database=sqlite --path=database/migrations
Now, you can convert the database schema from MySQL to SQLite by running the following command:
php artisan db:convert mysql sqlite
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.