/**
  * Constructor
  *
  * @param \Phinx\Db\Adapter\AdapterInterface $adapter The original adapter to decorate.
  * @param \CoreTyson\Database\Database $connection The connection to actually use.
  */
 public function __construct(AdapterInterface $adapter, Database $connection)
 {
     $this->adapter = $adapter;
     $this->connection = $connection;
     $pdo = $adapter->getConnection();
     $connection->driver()->connection($pdo);
 }
Exemple #2
0
 /**
  * Generate the SQL statements to drop the constraints to the table
  *
  * @param Database $connection The connection to generate SQL for.
  * @return array SQL to drop a table.
  */
 public function dropConstraintSql(Database $connection)
 {
     $dialect = $connection->driver()->schemaDialect();
     return $dialect->dropConstraintSql($this);
 }