Created
October 10, 2019 15:08
-
-
Save ahmadrio/5cc6bad63c573c27294d82e0fbcc59d8 to your computer and use it in GitHub Desktop.
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 App\Helpers\Traits\SQLServerServices; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class ChangeColumnInUsersTable extends Migration | |
{ | |
use SQLServerServices; | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
if ($this->dropConstraints('sqlsrv', 'users', ['tanggal_daftar'])) { | |
DB::statement("ALTER TABLE users ALTER COLUMN tanggal_daftar nvarchar(191)"); | |
} | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
if ($this->dropConstraints('sqlsrv', 'users', ['tanggal_daftar'])) { | |
DB::statement("ALTER TABLE users ALTER COLUMN tanggal_daftar datetime"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment