Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Sammyjo20/9db0ccea0914455bd6289bd904bab90a to your computer and use it in GitHub Desktop.
Save Sammyjo20/9db0ccea0914455bd6289bd904bab90a to your computer and use it in GitHub Desktop.
Migrate Haystack tables to v0.8.x
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddMissingHaystackColumnsFromVersionZeroDotEight extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('haystacks', function (Blueprint $table) {
$table->dropColumn('return_data');
$table->text('options');
});
Schema::table('haystack_data', function (Blueprint $table) {
$table->longText('value')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('haystacks', function (Blueprint $table) {
$table->dropColumn('options');
$table->boolean('return_data')->default(true);
});
Schema::table('haystack_data', function (Blueprint $table) {
$table->binary('value')->change();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment