mikedfunk / db-drop-tables by mikedfunk

A laravel command to drop all mysql database tables
1,162
1
2
Package Data
Maintainer Username: mikedfunk
Maintainer Contact: mike@mikefunk.com (Mike Funk)
Package Create Date: 2014-10-04
Package Last Update: 2014-10-31
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-22 03:15:23
Package Statistics
Total Downloads: 1,162
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

db-drop-tables

Build Status

In development, schema can be constantly changing. You don't want to have to add a migration file for every single column modification/addition/removal, do you? So just run this, then artisan migrate, then artisan db:seed. Or wrap those up in a phing command (or another artisan command) and do them in one shot.

Installation

  1. Install via composer: composer require --dev mikefunk/db-drop-tables:dev-master
  2. Add the service provider to your app/config/app.php in the providers area: 'MikeFunk\DbDropTables\DbDropTablesServiceProvider',
  3. This will not work until you add a connection for the mysql_information_schema database in app/config/database.php:
'mysql_information_schema' => array(
    'driver'    => 'mysql',
    'host'      => 'my_host_name'
    'database'  => 'INFORMATION_SCHEMA',
    'username'  => 'my_db_username'
    'password'  => 'my_db_password'
),

Usage

Call the command from within laravel with php artisan db:drop-tables. It will confirm that you want to drop all of your tables in your MySQL database. Want to skip the question and just do it? use --no-interaction or -n.