summaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-07 15:15:53 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-07-05 13:02:16 +0200
commitfe6e8c2710a4df0aedc9dd4d2323ed009a53a763 (patch)
tree1f55b5e9b0cbeb39d81e07c237869bc4cb6bf742 /apps/twofactor_backupcodes
parent543c181ec5c0b41a6e54bc59bfc1501fa53e8052 (diff)
downloadnextcloud-server-fe6e8c2710a4df0aedc9dd4d2323ed009a53a763.tar.gz
nextcloud-server-fe6e8c2710a4df0aedc9dd4d2323ed009a53a763.zip
Fix dropping tables and handle the prefix automatically
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/twofactor_backupcodes')
-rw-r--r--apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607104347.php5
-rw-r--r--apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php8
2 files changed, 5 insertions, 8 deletions
diff --git a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607104347.php b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607104347.php
index 18d614f0b5b..a7823c5b7a8 100644
--- a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607104347.php
+++ b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607104347.php
@@ -39,10 +39,9 @@ class Version1002Date20170607104347 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
/** @var Schema $schema */
$schema = $schemaClosure();
- $prefix = $options['tablePrefix'];
- if (!$schema->hasTable($prefix . 'twofactor_backupcodes')) {
- $table = $schema->createTable($prefix . 'twofactor_backupcodes');
+ if (!$schema->hasTable('twofactor_backupcodes')) {
+ $table = $schema->createTable('twofactor_backupcodes');
$table->addColumn('id', Type::INTEGER, [
'autoincrement' => true,
diff --git a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php
index 1feae578965..dae9e011787 100644
--- a/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php
+++ b/apps/twofactor_backupcodes/lib/Migration/Version1002Date20170607113030.php
@@ -50,9 +50,8 @@ class Version1002Date20170607113030 extends SimpleMigrationStep {
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
/** @var Schema $schema */
$schema = $schemaClosure();
- $prefix = $options['tablePrefix'];
- if (!$schema->hasTable($prefix . 'twofactor_backup_codes')) {
+ if (!$schema->hasTable('twofactor_backup_codes')) {
// Legacy table does not exist
return;
}
@@ -96,10 +95,9 @@ class Version1002Date20170607113030 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
/** @var Schema $schema */
$schema = $schemaClosure();
- $prefix = $options['tablePrefix'];
- if ($schema->hasTable($prefix . 'twofactor_backup_codes')) {
- $schema->dropTable($prefix . 'twofactor_backup_codes');
+ if ($schema->hasTable('twofactor_backup_codes')) {
+ $schema->dropTable('twofactor_backup_codes');
return $schema;
}
return null;