Conoslidate external URLs for a place into a single JSON column

This commit is contained in:
Jonny Barnes 2017-06-29 12:34:25 +01:00
parent 3d734201a2
commit 8ae5d4e770
6 changed files with 63 additions and 22 deletions

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdatePlacesTableAddExternalUrls extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('places', function (Blueprint $table) {
$table->jsonb('external_urls')->nullable();
$table->index('external_urls');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('places', function (Blueprint $table) {
$table->dropIndex('places_external_urls_index');
$table->dropColumn('external_urls');
});
}
}