Skip to content
Python script that converts sql database tables into laravel migrations
Branch: master
Clone or download
Latest commit 7c12dcd Aug 20, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore feat: create comments from table columns. Aug 18, 2017
README.md update readme Jul 25, 2017
config.json feat: add new configuration "debug". Aug 19, 2017
retrieve_and_convert.php
retrieve_and_convert.py

README.md

sql-to-laravel-migration

A script to genenerate Laravel migrations from existing MySQL database.

It isn't super comprehensive and is meant to quicken the setting up of Laravel migrations on an existing database.

Specs

Python2.7 or PHP 7

Set Up

  1. install mysql python connector https://dev.mysql.com/downloads/connector/python/
  2. fill database connection details in ./config.json

Run

config.json

only_include_tables - takes precedence if tables are specified

exclude_tables - tables will be excluded

terminal

python

python retrieve_and_convert.py

or

python retrieve_and_convert.py <config file>

php

php -e retrieve_and_convert.php

or

php -e retrieve_and_convert.php <config file>

Output

Files will be in output folder

Contribution

Feel free to report any bugs or contribute!

You can’t perform that action at this time.