Lines 10695-10743
if ( CheckVersion($DBversion) ) {
Link Here
|
10695 |
SetVersion ($DBversion); |
10695 |
SetVersion ($DBversion); |
10696 |
} |
10696 |
} |
10697 |
|
10697 |
|
10698 |
$DBversion = "XXX"; |
|
|
10699 |
if(CheckVersion($DBversion)) { |
10700 |
$dbh->do(q{ |
10701 |
DROP TABLE IF EXISTS api_keys; |
10702 |
}); |
10703 |
$dbh->do(q{ |
10704 |
CREATE TABLE api_keys ( |
10705 |
borrowernumber int(11) NOT NULL, |
10706 |
api_key VARCHAR(255) NOT NULL, |
10707 |
active int(1) DEFAULT 1, |
10708 |
PRIMARY KEY (borrowernumber, api_key), |
10709 |
CONSTRAINT api_keys_fk_borrowernumber |
10710 |
FOREIGN KEY (borrowernumber) |
10711 |
REFERENCES borrowers (borrowernumber) |
10712 |
ON DELETE CASCADE ON UPDATE CASCADE |
10713 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
10714 |
}); |
10715 |
|
10716 |
print "Upgrade to $DBversion done (Bug 13920: Add API keys table)\n"; |
10717 |
SetVersion($DBversion); |
10718 |
} |
10719 |
|
10720 |
$DBversion = "XXX"; |
10721 |
if(CheckVersion($DBversion)) { |
10722 |
$dbh->do(q{ |
10723 |
DROP TABLE IF EXISTS api_timestamps; |
10724 |
}); |
10725 |
$dbh->do(q{ |
10726 |
CREATE TABLE api_timestamps ( |
10727 |
borrowernumber int(11) NOT NULL, |
10728 |
timestamp bigint, |
10729 |
PRIMARY KEY (borrowernumber), |
10730 |
CONSTRAINT api_timestamps_fk_borrowernumber |
10731 |
FOREIGN KEY (borrowernumber) |
10732 |
REFERENCES borrowers (borrowernumber) |
10733 |
ON DELETE CASCADE ON UPDATE CASCADE |
10734 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
10735 |
}); |
10736 |
|
10737 |
print "Upgrade to $DBversion done (Bug 13920: Add API timestamps table)\n"; |
10738 |
SetVersion($DBversion); |
10739 |
} |
10740 |
|
10741 |
$DBversion = "3.21.00.008"; |
10698 |
$DBversion = "3.21.00.008"; |
10742 |
if ( CheckVersion($DBversion) ) { |
10699 |
if ( CheckVersion($DBversion) ) { |
10743 |
$dbh->do(q{ |
10700 |
$dbh->do(q{ |
Lines 10773-10778
if ( CheckVersion($DBversion) ) {
Link Here
|
10773 |
SetVersion ($DBversion); |
10730 |
SetVersion ($DBversion); |
10774 |
} |
10731 |
} |
10775 |
|
10732 |
|
|
|
10733 |
$DBversion = "XXX"; |
10734 |
if(CheckVersion($DBversion)) { |
10735 |
$dbh->do(q{ |
10736 |
DROP TABLE IF EXISTS api_keys; |
10737 |
}); |
10738 |
$dbh->do(q{ |
10739 |
CREATE TABLE api_keys ( |
10740 |
borrowernumber int(11) NOT NULL, |
10741 |
api_key VARCHAR(255) NOT NULL, |
10742 |
last_request_time INT(11) default NULL, |
10743 |
active int(1) DEFAULT 1, |
10744 |
PRIMARY KEY (borrowernumber, api_key), |
10745 |
CONSTRAINT api_keys_fk_borrowernumber |
10746 |
FOREIGN KEY (borrowernumber) |
10747 |
REFERENCES borrowers (borrowernumber) |
10748 |
ON DELETE CASCADE ON UPDATE CASCADE |
10749 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
10750 |
}); |
10751 |
|
10752 |
print "Upgrade to $DBversion done (Bug 13920: Add API keys table)\n"; |
10753 |
SetVersion($DBversion); |
10754 |
} |
10755 |
|
10756 |
|
10776 |
# DEVELOPER PROCESS, search for anything to execute in the db_update directory |
10757 |
# DEVELOPER PROCESS, search for anything to execute in the db_update directory |
10777 |
# SEE bug 13068 |
10758 |
# SEE bug 13068 |
10778 |
# if there is anything in the atomicupdate, read and execute it. |
10759 |
# if there is anything in the atomicupdate, read and execute it. |