From b8d68bd74f32314fa36d8c2073fe77b22b914ee6 Mon Sep 17 00:00:00 2001 From: An Phan Date: Sat, 9 Jul 2016 13:57:59 +0800 Subject: [PATCH] Fix auto increment bug --- ...7_09_054503_fix_artist_autoindex_value.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 database/migrations/2016_07_09_054503_fix_artist_autoindex_value.php diff --git a/database/migrations/2016_07_09_054503_fix_artist_autoindex_value.php b/database/migrations/2016_07_09_054503_fix_artist_autoindex_value.php new file mode 100644 index 00000000..e62926e0 --- /dev/null +++ b/database/migrations/2016_07_09_054503_fix_artist_autoindex_value.php @@ -0,0 +1,36 @@ +first(); + DB::statement("ALTER TABLE artists AUTO_INCREMENT=".($latestArtist->id + 1)); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}