birzha/plugins/rainlab/userplus/updates/user_add_mobile_field.php

29 lines
603 B
PHP

<?php namespace RainLab\UserPlus\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class UserAddMobileField extends Migration
{
public function up()
{
if (Schema::hasColumn('users', 'mobile')) {
return;
}
Schema::table('users', function($table)
{
$table->string('mobile', 100)->nullable();
});
}
public function down()
{
if (Schema::hasTable('users')) {
Schema::table('users', function ($table) {
$table->dropColumn(['mobile']);
});
}
}
}