Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/resources/sql/autopatches/20140115.auth.3.unlimit.php
12250 views
1
<?php
2
3
// Prior to this patch, we issued sessions "web-1", "web-2", etc., up to some
4
// limit. This collapses all the "web-X" sessions into "web" sessions.
5
6
$session_table = new PhabricatorAuthSession();
7
$conn_w = $session_table->establishConnection('w');
8
9
foreach (new LiskMigrationIterator($session_table) as $session) {
10
$id = $session->getID();
11
12
echo pht('Migrating session %d...', $id)."\n";
13
$old_type = $session->getType();
14
$new_type = preg_replace('/-.*$/', '', $old_type);
15
16
if ($old_type !== $new_type) {
17
queryfx(
18
$conn_w,
19
'UPDATE %T SET type = %s WHERE id = %d',
20
$session_table->getTableName(),
21
$new_type,
22
$id);
23
}
24
}
25
26
echo pht('Done.')."\n";
27
28