Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3749372
D379.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D379.diff
View Options
diff --git a/database/migrations/2016_05_21_224200_set_users_table_auto_increment.php b/database/migrations/2016_05_21_224200_set_users_table_auto_increment.php
new file mode 100644
--- /dev/null
+++ b/database/migrations/2016_05_21_224200_set_users_table_auto_increment.php
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class SetUsersTableAutoIncrement extends Migration {
+
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ // See https://secure.phabricator.com/book/phabflavor/article/things_you_should_do_now/#start-ids-at-a-gigantic
+ $sql = "ALTER TABLE users AUTO_INCREMENT = 1000000000";
+ DB::unprepared($sql);
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ $maxId = (int)DB::table('users')->max('id');
+
+ $sql = "ALTER TABLE users AUTO_INCREMENT = " . ++$maxId;
+ DB::unprepared($sql);
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 14:50 (20 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249511
Default Alt Text
D379.diff (1 KB)
Attached To
Mode
D379: Start user accounts ID with a large value
Attached
Detach File
Event Timeline
Log In to Comment