2017 © Pedro PelĂĄez
 

library laravel-db-exporter

Database table structure and data exporter to migration and seed files

image

vi-kon/laravel-db-exporter

Database table structure and data exporter to migration and seed files

  • Saturday, April 30, 2016
  • by vincekovacs
  • Repository
  • 2 Watchers
  • 10 Stars
  • 3,876 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 5 Open issues
  • 4 Versions
  • 7 % Grown

The README.md

Database exporter to Laravel 5

This is database table structure and data exporter to migration and seed files for Laravel 5, (*1)

Table of content

Features

  • create migration files from database table structure
  • handle foreign keys (watch for recursive foreign keys)
  • create model files from database table structure
  • create seed files from database table content

Installation

To composer.json file add following lines:, (*2)

// to "require" object
"vi-kon/db-exporter": "~1.*"

Or run following command in project root:, (*3)

composer require vi-kon/db-exporter

In Laravel 5 project add following lines to app.php:, (*4)

// to providers array
'ViKon\DbExporter\DbExporterServiceProvider',

Usages

Creating migration files

The db-exporter:migrate commend is used for creating migration files from database. It has several options:, (*5)

  • prefix - database name prefix in migration files
  • ignore - array of ignored database table names
  • database - specify database connection name. If option is not set the default connection is used
  • overwrite - force overwriting existing migration files

The example assumes following database tables:, (*6)

  • users
  • groups
  • pages with foreign key to user id

Exports all tables from default database:, (*7)

php artisan db-exporter:migrate

The above command will generate following files to database/migrations directory:, (*8)

YYYY-MM-DD_000000_create_users_table.php
YYYY-MM-DD_000001_create_groups_table.php
YYYY-MM-DD_000002_create_pages_table.php

License

This package is licensed under the MIT License, (*9)


Back to top, (*10)

The Versions

30/04 2016

dev-core-rewrite

dev-core-rewrite

Database table structure and data exporter to migration and seed files

  Sources   Download

MIT

The Requires

 

by KovĂĄcs Vince

database laravel migration seeder exporter

25/04 2016

dev-develop

dev-develop

Database table structure and data exporter to migration and seed files

  Sources   Download

MIT

The Requires

 

by KovĂĄcs Vince

database laravel migration seeder exporter

22/03 2015

dev-master

9999999-dev

Database table structure and data exporter to migration and seed files

  Sources   Download

MIT

The Requires

 

by KovĂĄcs Vince

database laravel migration seeder exporter

22/03 2015

v1.0

1.0.0.0

Database table structure and data exporter to migration and seed files

  Sources   Download

MIT

The Requires

 

by KovĂĄcs Vince

database laravel migration seeder exporter