Moved database driver constants to DatabaseDriver

This commit is contained in:
Matthew Barbour
2019-06-20 10:42:32 -05:00
committed by matthew
parent d128dfa78e
commit 1370afec72
19 changed files with 57 additions and 53 deletions

View File

@@ -37,7 +37,7 @@ class RatingSetEvent extends Event
class Ratings extends Extension
{
protected $db_support = [Database::MYSQL_DRIVER,Database::PGSQL_DRIVER];
protected $db_support = [DatabaseDriver::MYSQL, DatabaseDriver::PGSQL];
public function get_priority(): int
{
@@ -331,10 +331,10 @@ class Ratings extends Extension
if ($config->get_int("ext_ratings2_version") < 3) {
$database->Execute("UPDATE images SET rating = 'u' WHERE rating is null");
switch ($database->get_driver_name()) {
case Database::MYSQL_DRIVER:
case DatabaseDriver::MYSQL:
$database->Execute("ALTER TABLE images CHANGE rating rating CHAR(1) NOT NULL DEFAULT 'u'");
break;
case Database::PGSQL_DRIVER:
case DatabaseDriver::PGSQL:
$database->Execute("ALTER TABLE images ALTER COLUMN rating SET DEFAULT 'u'");
$database->Execute("ALTER TABLE images ALTER COLUMN rating SET NOT NULL");
break;