Skip to content

Commit

Permalink
Remove extended class of Phalcon PDO and Dialect
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Mar 21, 2020
1 parent a6bc4e2 commit 58c383b
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 309 deletions.
80 changes: 0 additions & 80 deletions src/Db/Adapter/Pdo/PdoPostgresql.php

This file was deleted.

61 changes: 0 additions & 61 deletions src/Db/Dialect/DialectMysql.php

This file was deleted.

60 changes: 0 additions & 60 deletions src/Db/Dialect/DialectPostgresql.php

This file was deleted.

7 changes: 0 additions & 7 deletions src/Migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
use Phalcon\Db\Exception as DbException;
use Phalcon\Migrations\Console\Color;
use Phalcon\Migrations\Console\OptionStack;
use Phalcon\Migrations\Db\Dialect\DialectMysql;
use Phalcon\Migrations\Db\Dialect\DialectPostgresql;
use Phalcon\Migrations\Exception\RuntimeException;
use Phalcon\Migrations\Mvc\Model\Migration as ModelMigration;
use Phalcon\Migrations\Mvc\Model\Migration\TableAware\ListTablesDb;
Expand Down Expand Up @@ -493,14 +491,9 @@ private static function connectionSetup(array $options): void
self::$storage = new $adapter($configArray);

if ($database->adapter === 'Mysql') {
self::$storage->setDialect(new DialectMysql());
self::$storage->query('SET FOREIGN_KEY_CHECKS=0');
}

if ($database->adapter == 'Postgresql') {
self::$storage->setDialect(new DialectPostgresql());
}

if (!self::$storage->tableExists(self::MIGRATION_LOG_TABLE)) {
self::createLogTable();
}
Expand Down
15 changes: 1 addition & 14 deletions src/Mvc/Model/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
use Phalcon\Config;
use Phalcon\Db\Adapter\AbstractAdapter;
use Phalcon\Db\Adapter\Pdo\Mysql as PdoMysql;
use Phalcon\Db\Adapter\Pdo\Postgresql as PdoPostgresql;
use Phalcon\Db\ColumnInterface;
use Phalcon\Db\Enum;
use Phalcon\Db\Exception as DbException;
use Phalcon\Db\ReferenceInterface;
use Phalcon\Events\Manager as EventsManager;
use Phalcon\Migrations\Db\Adapter\Pdo\PdoPostgresql;
use Phalcon\Migrations\Db\Dialect\DialectMysql;
use Phalcon\Migrations\Db\Dialect\DialectPostgresql;
use Phalcon\Migrations\Exception\Db\UnknownColumnTypeException;
use Phalcon\Migrations\Generator\Snippet;
use Phalcon\Migrations\Listeners\DbProfilerListener;
Expand Down Expand Up @@ -93,7 +91,6 @@ class Migration
* @param Config $database Database config
* @param bool $verbose array with settings
* @throws DbException
* @since 3.2.1 Using Postgresql::describeReferences and DialectPostgresql dialect class
*/
public static function setup(Config $database, bool $verbose = false): void
{
Expand Down Expand Up @@ -123,16 +120,6 @@ public static function setup(Config $database, bool $verbose = false): void
self::$connection = new $adapter($configArray);
self::$databaseConfig = $database;

// Connection custom dialect Dialect/DialectMysql
if ($database->adapter == 'Mysql') {
self::$connection->setDialect(new DialectMysql());
}

// Connection custom dialect Dialect/DialectPostgresql
if ($database->adapter == 'Postgresql') {
self::$connection->setDialect(new DialectPostgresql());
}

if (!Migrations::isConsole() || !$verbose) {
return;
}
Expand Down
29 changes: 0 additions & 29 deletions tests/unit/Db/Adapter/Pdo/PdoPostgresqlTest.php

This file was deleted.

29 changes: 0 additions & 29 deletions tests/unit/Db/Dialect/DialectMysqlTest.php

This file was deleted.

29 changes: 0 additions & 29 deletions tests/unit/Db/Dialect/DialectPostgresqlTest.php

This file was deleted.

0 comments on commit 58c383b

Please sign in to comment.