Skip to content

Commit

Permalink
Merge pull request #28 from karhel/develop
Browse files Browse the repository at this point in the history
Fix Table and Fields exists test (deprecated)
  • Loading branch information
karhel authored Feb 24, 2019
2 parents fdca51b + 68f2819 commit 4dfb941
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions inc/individualscategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function install(Migration $migration)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$migration->displayMessage(sprintf(__("Installing %s"), $table));

Expand Down Expand Up @@ -93,7 +93,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table");
}
Expand Down
4 changes: 2 additions & 2 deletions inc/lawfulbasismodel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$migration->displayMessage(sprintf(__("Installing %s"), $table));

Expand Down Expand Up @@ -104,7 +104,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table");
}
Expand Down
4 changes: 2 additions & 2 deletions inc/personaldatacategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$migration->displayMessage(sprintf(__("Installing %s"), $table));

Expand Down Expand Up @@ -101,7 +101,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table");
}
Expand Down
10 changes: 5 additions & 5 deletions inc/processing.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$migration->displayMessage(sprintf(__("Installing %s"), $table));

Expand Down Expand Up @@ -142,7 +142,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {

$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table " . $DB->error());
Expand Down Expand Up @@ -611,13 +611,13 @@ static function checkLawfulbasisField()
$lawfulbasisTable = PluginDporegisterLawfulBasisModel::getTable();
$lawfulbasisForeignKey = PluginDporegisterLawfulBasisModel::getForeignKeyField();

if (!FieldExists($table, $lawfulbasisForeignKey)) {
if (!$DB->fieldExists($table, $lawfulbasisForeignKey)) {

$query = "ALTER TABLE `$table` ADD `$lawfulbasisForeignKey` int(11) NOT NULL default '0' COMMENT 'RELATION to $lawfulbasisTable (id)';";
$DB->query($query) or die("error altering $table to add the new lawfulbasis column " . $DB->error());
}

if (FieldExists($table, 'lawfulbasis')) {
if ($DB->fieldExists($table, 'lawfulbasis')) {

$processings = (new PluginDporegisterProcessing())->find();
foreach ($processings as $resultSet) {
Expand Down Expand Up @@ -645,7 +645,7 @@ static function checkUsersFields()
$table = self::getTable();

// Check if users_id_jointcontroller field exist
if (FieldExists($table, 'users_id_jointcontroller')) {
if ($DB->fieldExists($table, 'users_id_jointcontroller')) {

$processings = (new PluginDporegisterProcessing())->find();

Expand Down
4 changes: 2 additions & 2 deletions inc/processing_individualscategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function install(Migration $migration, $version)

global $DB;
$table = self::getTable();
if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$migration->displayMessage(sprintf(__("Installing %s"), $table));

Expand All @@ -96,7 +96,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table " . $DB->error());
}
Expand Down
4 changes: 2 additions & 2 deletions inc/processing_personaldatacategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$query = "CREATE TABLE `$table` (
`id` int(11) NOT NULL auto_increment,
Expand Down Expand Up @@ -108,7 +108,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table " . $DB->error());
}
Expand Down
4 changes: 2 additions & 2 deletions inc/processing_securitymesure.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$query = "CREATE TABLE `$table` (
`id` int(11) NOT NULL auto_increment,
Expand All @@ -95,7 +95,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table " . $DB->error());
}
Expand Down
4 changes: 2 additions & 2 deletions inc/processing_software.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$query = "CREATE TABLE `$table` (
`id` int(11) NOT NULL auto_increment,
Expand All @@ -94,7 +94,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table " . $DB->error());
}
Expand Down
4 changes: 2 additions & 2 deletions inc/processing_supplier.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$query = "CREATE TABLE `$table` (
`id` int(11) NOT NULL auto_increment,
Expand Down Expand Up @@ -97,7 +97,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table " . $DB->error());
}
Expand Down
4 changes: 2 additions & 2 deletions inc/processing_user.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$query = "CREATE TABLE `$table` (
`id` int(11) NOT NULL auto_increment,
Expand Down Expand Up @@ -100,7 +100,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table " . $DB->error());
}
Expand Down
4 changes: 2 additions & 2 deletions inc/representative.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$query = "CREATE TABLE `$table` (
`id` int(11) NOT NULL auto_increment,
Expand All @@ -88,7 +88,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table");
}
Expand Down
4 changes: 2 additions & 2 deletions inc/securitymesure.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function install(Migration $migration, $version)
global $DB;
$table = self::getTable();

if (!TableExists($table)) {
if (!$DB->tableExists($table)) {

$query = "CREATE TABLE `$table` (
`id` int(11) NOT NULL auto_increment,
Expand Down Expand Up @@ -89,7 +89,7 @@ public static function uninstall()
global $DB;
$table = self::getTable();

if (TableExists($table)) {
if ($DB->tableExists($table)) {
$query = "DROP TABLE `$table`";
$DB->query($query) or die("error deleting $table");
}
Expand Down

0 comments on commit 4dfb941

Please sign in to comment.