Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F27207929
2016_05_21_224200_set_users_table_auto_increment.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
695 B
Referenced Files
None
Subscribers
None
2016_05_21_224200_set_users_table_auto_increment.php
View Options
<?php
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/x-php
Expires
Sun, May 3, 06:33 (20 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3659962
Default Alt Text
2016_05_21_224200_set_users_table_auto_increment.php (695 B)
Attached To
Mode
rGROVE Auth Grove
Attached
Detach File
Event Timeline
Log In to Comment