gurl_o/plugins/rainlab/user/updates/users_add_additionals.php

42 lines
1.3 KiB
PHP

<?php namespace RainLab\User\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class UsersAddAdditionals extends Migration
{
public function up()
{
Schema::table('users', function($table)
{
$table->string('type')->nullable();
$table->string('logo')->nullable();
$table->string('shop_title')->nullable();
$table->string('slogan')->nullable();
$table->string('work_time')->nullable();
$table->string('description')->nullable();
$table->string('map')->nullable();
$table->boolean('is_instagram')->default(false);
$table->string('note')->nullable();
});
}
public function down()
{
if (Schema::hasColumn('users', 'type')) {
Schema::table('users', function($table)
{
$table->dropColumn('type');
$table->dropColumn('logo');
$table->dropColumn('shop_title');
$table->dropColumn('slogan');
$table->dropColumn('work_time');
$table->dropColumn('description');
$table->dropColumn('map');
$table->dropColumn('is_instagram');
$table->dropColumn('note');
});
}
}
}