Skip to content

Instantly share code, notes, and snippets.

@kamaln7
Forked from clone1018/migration.php
Last active December 17, 2015 19:49
Show Gist options
  • Save kamaln7/5663076 to your computer and use it in GitHub Desktop.
Save kamaln7/5663076 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Database\Migrations\Migration;
class ImproveCfs extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cfs', function ($table) {
$table->enum('type', array('file', 'folder', 'link'))->after('name');
$table->string('mime')->nullable();
$table->renameColumn('s3', 'cloud');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cfs', function ($table) {
$table->dropColumn('type');
$table->dropColumn('mime');
$table->renameColumn('cloud', 's3');
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment