-
-
Save abr4xas/e1349b95ce4d2de8bac42058b5916ce4 to your computer and use it in GitHub Desktop.
Import mysql dump as laravel migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreatePostalCodesTable extends Migration { | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
$file = realpath(__DIR__.'/../catalogs/codigos_postales.sql'); | |
DB::unprepared( file_get_contents($file) ); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::drop('codigos_postales'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment