changed database column 'recovery' to 'recovery_enabled' because recovery is a pgsql keyword

more info about pgsql keywords http://www.postgresql.org/docs/9.1/static/sql-keywords-appendix.html
This commit is contained in:
Florin Peter 2013-05-19 07:04:31 +02:00
parent 2a038baee0
commit ddda2a1f79
2 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@
<comments>What client-side / server-side configuration is used</comments>
</field>
<field>
<name>recovery</name>
<name>recovery_enabled</name>
<type>boolean</type>
<notnull>true</notnull>
<default>0</default>

View File

@ -228,7 +228,7 @@ class Util {
if ( false === $this->recoveryEnabledForUser() ) {
// create database configuration
$sql = 'INSERT INTO `*PREFIX*encryption` (`uid`,`mode`,`recovery`) VALUES (?,?,?)';
$sql = 'INSERT INTO `*PREFIX*encryption` (`uid`,`mode`,`recovery_enabled`) VALUES (?,?,?)';
$args = array( $this->userId, 'server-side', 0);
$query = \OCP\DB::prepare( $sql );
$query->execute( $args );
@ -252,7 +252,7 @@ class Util {
public function recoveryEnabledForUser() {
$sql = 'SELECT
recovery
recovery_enabled
FROM
`*PREFIX*encryption`
WHERE
@ -268,7 +268,7 @@ class Util {
while( $row = $result->fetchRow() ) {
$recoveryEnabled[] = $row['recovery'];
$recoveryEnabled[] = $row['recovery_enabled'];
}
@ -299,7 +299,7 @@ class Util {
if ( false === $recoveryStatus ) {
$sql = 'INSERT INTO `*PREFIX*encryption`
(`uid`,`mode`,`recovery`)
(`uid`,`mode`,`recovery_enabled`)
VALUES (?,?,?)';
$args = array( $this->userId, 'server-side', $enabled );
@ -310,7 +310,7 @@ class Util {
$sql = 'UPDATE
*PREFIX*encryption
SET
recovery = ?
recovery_enabled = ?
WHERE
uid = ?';