From 130484315549a8f2da479a5458246760aafd6259 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 31 Oct 2013 11:38:48 +0100 Subject: [PATCH] Refactored migration for compatibility with databases other than MySQL. Code provided by https://github.com/relu Signed-off-by: William --- .../2013_07_25_145958_create_language_entries_table.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/migrations/2013_07_25_145958_create_language_entries_table.php b/src/migrations/2013_07_25_145958_create_language_entries_table.php index ce5fbd0..21c6549 100644 --- a/src/migrations/2013_07_25_145958_create_language_entries_table.php +++ b/src/migrations/2013_07_25_145958_create_language_entries_table.php @@ -22,9 +22,8 @@ public function up() $table->boolean('unstable')->default('0'); $table->timestamps(); $table->foreign('language_id')->references('id')->on('languages'); + $table->unique(array('language_id', 'namespace', 'group', 'item')); }); - // Unique index: - DB::statement('ALTER TABLE `language_entries` ADD UNIQUE INDEX(`language_id`, `namespace`, `group`, `item`)'); } /**