]> source.dussan.org Git - nextcloud-server.git/commitdiff
Rename the table to a valid name
authorJoas Schilling <coding@schilljs.com>
Tue, 9 May 2017 14:59:18 +0000 (16:59 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Mon, 15 May 2017 20:41:45 +0000 (15:41 -0500)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/twofactor_backupcodes/appinfo/database.xml
apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php

index 02ca7c93a1eadd3f019f69bba82230df4f441f1a..90a77307688d39eb76667b81f51819e6c999e3b0 100644 (file)
@@ -5,7 +5,7 @@
        <overwrite>false</overwrite>
        <charset>utf8</charset>
        <table>
-               <name>*dbprefix*twofactor_backup_codes</name>
+               <name>*dbprefix*twofactor_backupcodes</name>
                <declaration>
                        <field>
                                <name>id</name>
index ff993683c59f4ce455982c2df1f19c79a094cda6..03fe7bb5ec86a6a597b9f941acd02678c269dcaf 100644 (file)
 namespace OCA\TwoFactorBackupCodes\Db;
 
 use OCP\AppFramework\Db\Mapper;
+use OCP\DB\QueryBuilder\IQueryBuilder;
 use OCP\IDBConnection;
 use OCP\IUser;
 
 class BackupCodeMapper extends Mapper {
 
        public function __construct(IDBConnection $db) {
-               parent::__construct($db, 'twofactor_backup_codes');
+               parent::__construct($db, 'twofactor_backupcodes');
        }
 
        /**
@@ -40,7 +41,7 @@ class BackupCodeMapper extends Mapper {
                $qb = $this->db->getQueryBuilder();
 
                $qb->select('id', 'user_id', 'code', 'used')
-                       ->from('twofactor_backup_codes')
+                       ->from('twofactor_backupcodes')
                        ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($user->getUID())));
                $result = $qb->execute();
 
@@ -66,7 +67,7 @@ class BackupCodeMapper extends Mapper {
                /* @var IQueryBuilder $qb */
                $qb = $this->db->getQueryBuilder();
 
-               $qb->delete('twofactor_backup_codes')
+               $qb->delete('twofactor_backupcodes')
                        ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($uid)));
                $qb->execute();
        }