A MySQL Workbench plugin which exports a Model to Laravel 5 Migrations

Overview

MySQL Workbench Export Laravel 5 Migrations Plugin

A MySQL Workbench plugin that allows for exporting a model to Laravel 5 migrations that follow PSR-2 coding standards. When exported, each migration is generated and saved in it's own, properly named, migration file.

Version

0.1.5

Tech

This plugin requires MySQL Workbench to work properly.

And of course this plugin is open source with a public repository on GitHub.

Installation

  • MySQL Workbench > Scripting > Install Plugin/Module
  • Select the plugin file
  • Click Open

Usage

  • Open a model in MySQL Workbench
  • Tools > Catalog > Export Laravel 5 Migration

Development

Want to contribute? Great!

Thanks

Thanks to all that have and continue to contribute to this project.

Extra thanks to VeeeneX for all the great PRs!

Todos

  • Types that are unsupported by Laravel

License

The MIT License (MIT)

Free Software, Hell Yeah!

Comments
  • Doesn't work with Workbench 8

    Doesn't work with Workbench 8

    I'm currently running Workbench 8.0.13, and on the readme.md file it says:

    Open a model in MySQL Workbench Tools > Catalog > Export Laravel 5 Migration

    But this option is no longer under tools in the latest version of Workbench.

    image

    opened by n8udd 17
  • No menu item on Ubuntu 14.04

    No menu item on Ubuntu 14.04

    I've installed the plugin (and it shows as enabled in Scripting -> Plugin Manager), but there is no Catalog menu option under Tools.

    I've restarted Workbench several times, and rebooted my computer.

    Linux Ubuntu 14.04 and Workbench 6.2

    opened by JonoB 9
  • Working with Laragon (and MariaDB)

    Working with Laragon (and MariaDB)

    Hi, I'm using Laragon for local development, which is shipped with MariaDB instead of MySQL. MySQL Benchmark is warning me about "incompatible/nonstandard server version or connection protocol detected" (see attachments), but I want to try anyway. The connection is successful and I can install the plugin, but I don't see the "Catalog" submenu under "Tools"... Is this a MySQL Benchmark issue or a plugin one? Can this be fixed somehow? Thank you :-)

    2016-12-22_10-59-16

    2

    3

    duplicate invalid 
    opened by ivansammartino 7
  • Files names not matching file content

    Files names not matching file content

    I have just installed the plugin into MySQL WorkBench 6.3 ce and when I try do an export it will export the objects but the filenames will not be match the object inside the file. So TableA's migration will be called 2017_11_30_000012_create_TableB_table.php and TableC's migration might be called 2017_11_30_000012_create_TableF_table.php

    opened by wwwillis 6
  • Mysqlworkbench 6.3.9 on Mac Sierra - export issues

    Mysqlworkbench 6.3.9 on Mac Sierra - export issues

    Hi there. Performing the export laravel 5 migration brings up the export dialog and shows me the review of what it's going to create, but I only get what I've attached in the screenshot. I don't get any options for where to save the generated migration scripts and it also never saves anything.

    Additionally, none of the foreign keys and references, nor indexes, are being included in the generated scripts

    screen shot 2017-02-08 at 4 43 53 pm

    opened by chorton 6
  • Laravel 8 migration version

    Laravel 8 migration version

    Hello,

    thank you once again for a terrific package!!

    Is it possible to create the laravel 8 version of this plugin with namespaces? Or can i add it manually?

    opened by nicolasvahidzein 5
  • Migrations do not contain column definitions

    Migrations do not contain column definitions

    Using MySQL Workbench latest (6.3.9) on Windows 10 and the latest version of the script on master the generated migrations do not contain any column definitions.

    With the MWB file linked here: https://dl.dropboxusercontent.com/u/12420042/test.mwb (which is just a simple test with a single table with a PK and varchar field) the resulting migration is:

    <?php
    
    use Illuminate\Database\Schema\Blueprint;
    use Illuminate\Database\Migrations\Migration;
    
    class CreateTracksTable extends Migration
    {
        /**
         * Run the migrations.
         * @table tracks
         *
         * @return void
         */
        public function up()
        {
            Schema::create('tracks', function (Blueprint $table) {
                $table->engine = 'InnoDB';
            });
        }
    
        /**
         * Reverse the migrations.
         *
         * @return void
         */
         public function down()
         {
           Schema::dropIfExists('tracks');
         }
    }
    

    I thought that maybe the MWB application version was too new so tried downgrading from 6.3.8 progressively to 6.3.5 but the migration generated was the same in each version. So either there's a bug or I'm missing something obvious on my end.

    opened by carnedv 5
  • Windows - memory leak, program not responding

    Windows - memory leak, program not responding

    Hey, I tested the plugin for my model and I came across a problem. When I try export my migrations the program is not responding and RAM consumption is growing very rapidly in time. Unfortunately, the application log is empty and the application even after a long time does not turn off. Can I provide some additional information to help solve the problem? przechwytywanie Here is my model: database_model.zip

    bug 
    opened by daverdalas 4
  • Getting 'error calling Python module'

    Getting 'error calling Python module'

    Hi, I just installed the plugin (seemed to install cleanly!), and I'm getting the following error

    Error during "Export Laravel 5 Migration" error calling Python module function GenerateLaravel5Migration.generateLaravel5Migration

    I've done some digging but can't find any info on what may be causing this - not sure if it's an problem on the plugin side, mysql workbench side, or other. Any hints on this? (note: I'm not very familiar with mysql workbench...)

    Thanks!

    opened by benxmy 4
  • fixed table columns not exporting

    fixed table columns not exporting

    Don't ask me why but for some reason the following did not work even though the col had a name attribute: if hasattr(col, 'name'): continue So i switched it out for a try catch, which will catch the error if there is no name attribute.

    opened by robvankeilegom 3
  • indices are generated now at least for MyISAM tables

    indices are generated now at least for MyISAM tables

    I had the issue that the indices are not generated at all, neither for MyISAM, nor InnoDB tables.

    The indices are generated correctly now, at least for MyISAM tables. The issue still exists for InnoDB tables, because no columns are assigned to the index.

    opened by abachmann 3
  • workbench does not start after plugin installation

    workbench does not start after plugin installation

    Does anyone know how to solve this?

    C:\Users\xxxx\AppData\Roaming\MySQL\Workbench\log
    

    shows

    10:05:09 [ERR][      Workbench]: Console redirection failed.
    10:05:09 [INF][      Workbench]: Starting up Workbench
    10:05:09 [INF][      Workbench]: Current environment:
    	Command line: "C:\Program Files\MySQL\MySQL Workbench 8.0 CE\MySQLWorkbench.exe" 
    	CurrentDirectory: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
    	HasShutdownStarted: False
    	OSVersion: Microsoft Windows NT 6.2.9200.0
    	SystemDirectory: C:\Windows\system32
    	TickCount: 29625
    	UserInteractive: True
    	Version: 4.0.30319.42000
    	WorkingSet: 41918464
    10:05:09 [INF][      Workbench]: Environment variables:
    	OneDriveConsumer = C:\Users\xxxx\OneDrive
    	ProgramFiles(x86) = C:\Program Files (x86)
    	ProgramW6432 = C:\Program Files
    	ChocolateyInstall = C:\ProgramData\chocolatey
    	PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
    	TMP = C:\Users\xxxx\AppData\Local\Temp
    	PROCESSOR_ARCHITECTURE = AMD64
    	Path = C:\Python39\Scripts\;C:\Python39\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\PuTTY\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\php-7.4.14-nts-Win32-vc15-x64;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Users\xxxx\AppData\Roaming\MySQL\Workbench\modules;C:\Users\xxxx\AppData\Local\Microsoft\WindowsApps;C:\Users\xxxx\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\heroku\bin;C:\apache-maven-3.6.3\bin;C:\Users\xxxx\AppData\Roaming\Composer\vendor\bin;C:\php-7.4.14-nts-Win32-vc15-x64;D:\xampp\mysql\bin;C:\Users\xxxx\AppData\Roaming\npm;C:\Users\xxxx\AppData\Roaming\MySQL\Workbench\modules;
    	USERPROFILE = C:\Users\xxxx
    	PROCESSOR_REVISION = 3c03
    	TEMP = C:\Users\xxxx\AppData\Local\Temp
    	FPS_BROWSER_APP_PROFILE_STRING = Internet Explorer
    	FPS_BROWSER_USER_PROFILE_STRING = Default
    	LOGONSERVER = \\DESKTOP-28IRB1E
    	USERNAME = xxxx
    	SystemRoot = C:\Windows
    	OneDrive = C:\Users\xxxx\OneDrive
    	CommonProgramFiles = C:\Program Files\Common Files
    	ProgramData = C:\ProgramData
    	HOMEPATH = \Users\xxxx
    	COMPUTERNAME = DESKTOP-28IRB1E
    	CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
    	ALLUSERSPROFILE = C:\ProgramData
    	CommonProgramW6432 = C:\Program Files\Common Files
    	MAVEN_HOME = C:\Apache_Maven\apache-maven-3.6.3
    	SESSIONNAME = Console
    	DriverData = C:\Windows\System32\Drivers\DriverData
    	HOMEDRIVE = C:
    	windir = C:\Windows
    	SystemDrive = C:
    	NUMBER_OF_PROCESSORS = 8
    	OS = Windows_NT
    	ProgramFiles = C:\Program Files
    	ComSpec = C:\Windows\system32\cmd.exe
    	M2_HOME = C:\Apache_Maven\apache-maven-3.6.3
    	PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
    	JAVA_HOME = c:\Progra~1\Java\jdk-15.0.1
    	PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    	APPDATA = C:\Users\xxxx\AppData\Roaming
    	USERDOMAIN = DESKTOP-28IRB1E
    	PROCESSOR_LEVEL = 6
    	LOCALAPPDATA = C:\Users\xxxx\AppData\Local
    	ChocolateyLastPathUpdate = 132507832696870653
    	USERDOMAIN_ROAMINGPROFILE = DESKTOP-28IRB1E
    	PUBLIC = C:\Users\Public
    10:05:09 [INF][      Workbench]: Current version given by meta info is: 8.0.25
    10:05:10 [INF][      Workbench]: Setting PATH to: C:\Windows\system32;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\PuTTY\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\php-7.4.14-nts-Win32-vc15-x64;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Users\xxxx\AppData\Roaming\MySQL\Workbench\modules;C:\Users\xxxx\AppData\Local\Microsoft\WindowsApps;C:\Users\xxxx\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\heroku\bin;C:\apache-maven-3.6.3\bin;C:\Users\xxxx\AppData\Roaming\Composer\vendor\bin;C:\php-7.4.14-nts-Win32-vc15-x64;D:\xampp\mysql\bin;C:\Users\xxxx\AppData\Roaming\npm;C:\Users\xxxx\AppData\Roaming\MySQL\Workbench\modules;
    10:05:10 [INF][ mforms managed]: Initializing mforms wrapper
    10:05:10 [INF][   WBContext UI]: Initializing workbench context UI with these values:
    	base dir: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
    	plugin path: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
    	struct path: 
    	module path: C:\Program Files\MySQL\MySQL Workbench 8.0 CE/modules
    	library path: C:\Program Files\MySQL\MySQL Workbench 8.0 CE
    	user data dir: C:\Users\xxxx\AppData\Roaming\MySQL\Workbench
    	open at start: 
    	open type: 
    	run at startup: 
    	run type: 
    	Force SW rendering: No
    	Force OpenGL: No
    	quit when done: No
    10:05:10 [INF][      WBContext]: WbContext::init
    
    

    Event viewer Information:

    Fault bucket 2044772393984538788, type 4
    Event Name: APPCRASH
    Response: Not available
    Cab Id: 0
    
    Problem signature:
    P1: MySQLWorkbench.exe
    P2: 8.0.25.0
    P3: 6089097e
    P4: python37.dll
    P5: 3.7.7150.1013
    P6: 5f8050b5
    P7: c0000005
    P8: 000000000013c7d4
    P9: 
    P10: 
    
    

    Event viewer error:

    Faulting application name: MySQLWorkbench.exe, version: 8.0.25.0, time stamp: 0x6089097e
    Faulting module name: python37.dll, version: 3.7.7150.1013, time stamp: 0x5f8050b5
    Exception code: 0xc0000005
    Fault offset: 0x000000000013c7d4
    Faulting process id: 0x1b78
    Faulting application start time: 0x01d752cfadb80b31
    Faulting application path: C:\Program Files\MySQL\MySQL Workbench 8.0 CE\MySQLWorkbench.exe
    Faulting module path: C:\Program Files\MySQL\MySQL Workbench 8.0 CE\python37.dll
    Report Id: 5a137757-619e-464b-b13d-826e4a7be169
    Faulting package full name: 
    Faulting package-relative application ID: 
    
    opened by spook1 3
  • Two tables referencing each other

    Two tables referencing each other

    If I have two tables that reference each other and try to export the migration it just hangs and my laptop fans spin up very fast and I need to force quit Workbench. I'm guessing an infinite loop somewhere?

    My scenario (see image below) is if you have a company that has many employees, but one employee (usually the owner) has to take responsibility for the company.

    image

    opened by Erik-Jonker 0
  • have bug in foreign key

    have bug in foreign key

    when a foreign column create it must have same type

    table a id => unsigned and integer

    table b parent (foreign key with table a)

    parent => integer

    *** parent must unsignedInteger

    opened by vahidalvandi 2
Releases(v0.1.5)
Owner
Brandon Eckenrode
Brandon Eckenrode
ICEcoder is a browser based code editor, which provides a modern approach to building websites

ICEcoder Code editor awesomeness ...in your browser ICEcoder is a browser based code editor, which provides a modern approach to building websites. By

ICEcoder 1.4k Dec 18, 2022
InfyOm Laravel Generator - API, Scaffold, Tests, CRUD Laravel Generator

InfyOm Laravel Generator Generate Admin Panels CRUDs and APIs in Minutes with tons of other features and customizations with 3 different themes. Read

InfyOmLabs (InfyOm Technologies) 3.5k Jan 1, 2023
:rocket: A Smart CRUD Generator For Laravel

Features Generate your models, views, controllers, routes and migrations just in a few clicks. Models visualization through a graph presentation (New

Houssain Amrani 891 Dec 23, 2022
Laravel IDE Helper

Laravel IDE Helper Generator Complete PHPDocs, directly from the source This package generates helper files that enable your IDE to provide accurate a

Barry vd. Heuvel 12.8k Dec 29, 2022
This package extends the core file generators that are included with Laravel 5

Extended Migration Generators for Laravel 6, 7 and 8 Easily define the migration schema right in your make:migration command. The new commands this pa

Laracasts 2.4k Dec 29, 2022
⛔️ Laravel Tinx is archived and no longer maintained.

⛔️ Laravel Tinx (Deprecated) Laravel Tinx was archived on 12th December 2019 and is no longer maintained. Looking for a reloadable version of Laravel

James Furey 440 Dec 27, 2022
Laravel API Documentation Generator

Laravel API Documentation Generator Automatically generate your API documentation from your existing Laravel/Lumen/Dingo routes. php artisan apidoc:ge

Marcel Pociot 3.3k Dec 21, 2022
A cli tool for creating Laravel packages

Laravel Packager This package provides you with a simple tool to set up a new package and it will let you focus on the development of the package inst

JeroenG 1.3k Dec 22, 2022
⚙️ A Laravel package to decompose your installed packages, their dependencies, your app & server environment

Introduction Laravel Decomposer decomposes and lists all the installed packages and their dependencies along with the Laravel & the Server environment

LUBUS 513 Dec 30, 2022
🍪 Write gorgeous documentation for your products using Markdown inside your Laravel app.

LaRecipe Write gorgeous documentations for your products using Markdown inside your Laravel app. LaRecipe ?? LaRecipe is simply a code-driven package

Saleem Hadad 2.1k Dec 29, 2022
Prequel for Laravel. Clear and concise database management.

TL;DR? Test Prequel here! What is Prequel exactly? Prequel is meant to be a database management tool for Laravel to replace the need for separate stan

Protoqol 1.4k Dec 27, 2022
Module Generator Composer Package For Laravel

Module Generator Installation You can install the package via composer: composer require teacoders/module-generator Run the command below to publish t

Tea Coders 21 Jan 8, 2022
Creates an 'artisan workflow:make' command to scaffold out a number of useful GitHub actions workflows for Laravel

Laravel workflow generator This creates a make:workflow artisan command to scaffold out a number of useful GitHub actions workflows for Laravel. Insta

Len Woodward 9 Jul 18, 2021
Database migrations for PHP ala ActiveRecord Migrations with support for MySQL, Postgres, SQLite

Introduction Ruckusing is a framework written in PHP5 for generating and managing a set of "database migrations". Database migrations are declarative

Cody Caughlan 506 Nov 17, 2022
Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.

Laravel Migrations Generator Generate Laravel Migrations from an existing database, including indexes and foreign keys! Upgrading to Laravel 5.4 Pleas

Bernhard Breytenbach 3.3k Dec 30, 2022
Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.

Laravel Migrations Generator Generate Laravel Migrations from an existing database, including indexes and foreign keys! This package is cloned from ht

Kit Loong 1.4k Jan 1, 2023
🚀 Supercharged Excel exports and imports in Laravel

Supercharged Excel exports and imports A simple, but elegant Laravel wrapper around PhpSpreadsheet exports and imports. Quickstart · Documentation · V

Maatwebsite 11.2k Jan 4, 2023
🚀 Supercharged Excel exports and imports in Laravel

Supercharged Excel exports and imports A simple, but elegant Laravel wrapper around PhpSpreadsheet exports and imports. Quickstart · Documentation · V

Spartner 11.2k Dec 29, 2022
Authoring Tool and Language Workbench for Online Courses

Authoring Tool and Language Workbench for Online Courses

sellquiz 1 Feb 2, 2022
A workbench for developing Composer packages.

studio Installation Usage Workflow Command Reference License Contributing For enterprise Develop your Composer libraries with style. This package make

Franz Liedke 1.1k Jan 3, 2023