blue-twilight/database/migrations/2016_10_28_043532_add_stora...

47 lines
1.4 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStorageOpenstackColumns extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('storages', function (Blueprint $table) {
$table->string('auth_url')->nullable();
$table->string('tenant_name')->nullable();
$table->string('username')->nullable();
$table->string('password')->nullable();
$table->string('service_name')->nullable();
$table->string('service_region')->nullable();
$table->string('container_name')->nullable();
$table->string('location')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('storages', function (Blueprint $table) {
$table->string('location')->change();
$table->dropColumn('container_name');
$table->dropColumn('service_region');
$table->dropColumn('service_name');
$table->dropColumn('password');
$table->dropColumn('username');
$table->dropColumn('tenant_name');
$table->dropColumn('auth_url');
});
}
}