From 4e417fcf21a9471b3d4407ae653d5a69802efd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Vikstr=C3=B6m?= Date: Tue, 5 Jul 2016 17:48:45 +0200 Subject: [PATCH 1/2] Change type of versionable_id and versionable_type, index versionable_id --- ..._change_versionable_id_and_type_fields.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/migrations/2016_07_05_213644_change_versionable_id_and_type_fields.php diff --git a/src/migrations/2016_07_05_213644_change_versionable_id_and_type_fields.php b/src/migrations/2016_07_05_213644_change_versionable_id_and_type_fields.php new file mode 100644 index 0000000..4de70d5 --- /dev/null +++ b/src/migrations/2016_07_05_213644_change_versionable_id_and_type_fields.php @@ -0,0 +1,38 @@ +integer('versionable_id')->unsigned()->change(); + $table->string('versionable_type')->change(); + $table->index('versionable_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('versions', function(Blueprint $table) + { + $table->integer('versionable_id')->change(); + $table->text('versionable_type')->change(); + $table->dropIndex('versions_versionable_id_index'); + }); + } + +} From a30f0f4518242986432e30786575b6e4d79744b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Vikstr=C3=B6m?= Date: Tue, 5 Jul 2016 17:50:20 +0200 Subject: [PATCH 2/2] Fix indentation in migrations --- .../2016_07_05_213644_change_versionable_id_and_type_fields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/migrations/2016_07_05_213644_change_versionable_id_and_type_fields.php b/src/migrations/2016_07_05_213644_change_versionable_id_and_type_fields.php index 4de70d5..56417c5 100644 --- a/src/migrations/2016_07_05_213644_change_versionable_id_and_type_fields.php +++ b/src/migrations/2016_07_05_213644_change_versionable_id_and_type_fields.php @@ -30,7 +30,7 @@ public function down() Schema::table('versions', function(Blueprint $table) { $table->integer('versionable_id')->change(); - $table->text('versionable_type')->change(); + $table->text('versionable_type')->change(); $table->dropIndex('versions_versionable_id_index'); }); }