Created
March 25, 2017 02:24
-
-
Save chihirokaasan/22b6758e366d78f7cbaca12ddd4e21e9 to your computer and use it in GitHub Desktop.
migrationfile zerofill
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 AddZerofill extends Migration { | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::table('table_name', function(Blueprint $table) | |
{ | |
$sql = 'ALTER TABLE table_name ADD column_name INT ZEROFILL'; | |
DB::statement($sql); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::table('table_name', function(Blueprint $table) | |
{ | |
// | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment