srchub

srchub Commit Details


Date:2013-08-11 15:05:46 (11 years 4 months ago)
Author:Natalie Adams
Branch:master
Commit:a7e1392f53d07e4827dff0b901b5cf2f3a0e2392
Parents: 3f69ca67b789b2324e34372d2965e37de2e42417
Message:Adding migration for OTP field

Changes:

File differences

indefero/src/IDF/Migrations/28OTPKey.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
function IDF_Migrations_28OTPKey_up()
{
$table = Pluf::factory('Pluf_User')->getSqlTable();
$sql = array();
$sql["MySQL"] = "ALTER TABLE " . $table . " ADD COLUMN `otpkey` VARCHAR(50) NULL AFTER `last_login`;";
$db = Pluf::db();
$engine = Pluf::f('db_engine');
if (!isset($sql[$engine])) {
throw new Exception('SQLite complex migration not supported.');
}
$db->execute($sql[$engine]);
}
function IDF_Migrations_28OTPKey_down()
{
$table = Pluf::factory('Pluf_User')->getSqlTable();
$sql = array();
$sql["MySQL"] = "ALTER TABLE " . $table . " DROP COLUMN `otpkey`;";
$db = Pluf::db();
$engine = Pluf::f('db_engine');
if (!isset($sql[$engine])) {
throw new Exception('SQLite complex migration not supported.');
}
$db->execute($sql[$engine]);
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05696s using 14 queries.