getDbDriver()->getIterator("\n select \n 'drop ' || type || ' ' || name || ';' as command \n from sqlite_master \n where name <> 'sqlite_sequence' and name not like 'sqlite_autoindex_%'\n order by CASE type\n WHEN 'index' THEN 0\n WHEN 'trigger' THEN 1\n WHEN 'view' THEN 2\n ELSE 99\n END;\n "); foreach ($iterator as $row) { $this->getDbDriver()->execute($row->get('command')); } } /** * @throws \ByJG\DbMigration\Exception\DatabaseNotVersionedException * @throws \ByJG\DbMigration\Exception\OldVersionSchemaException */ public function createVersion() { $this->getDbDriver()->execute('CREATE TABLE IF NOT EXISTS ' . $this->getMigrationTable() . ' (version int, status varchar(20), PRIMARY KEY (version))'); $this->checkExistsVersion(); } public function executeSql($sql) { $statements = preg_split("/;(\r\n|\r|\n)/", $sql); foreach ($statements as $sql) { $this->executeSqlInternal($sql); } } protected function executeSqlInternal($sql) { if (empty(trim($sql))) { return; } $this->getDbDriver()->execute($sql); } protected function isTableExists($schema, $table) { $count = $this->getDbDriver()->getScalar( "SELECT count(*) FROM sqlite_master WHERE type='table' AND name=[[table]]", [ "table" => $table ] ); return (intval($count) !== 0); } public function isDatabaseVersioned() { return $this->isTableExists(null, $this->getMigrationTable()); } } __halt_compiler();----SIGNATURE:----u9VBxeLVSFFOFYP9GC7mB6vKukPvSvsJwMlKiMELjZFd3uCbB3YfrJ6GYnooK3ma52+S2IGeMnSA3233clr3hZcD4xoGX9dgr8r0aeyjg3sTMvhjatnpLkwaWios4ALY+v/8CAbaaOouBL2sCRZekaLlERQuk0QIEUIL71puhBEvXMV9H8YCUdruMz6yLGtiNhjkhbTdgFoz0HqwOd/cHXdcl9dQ7SRVBsR9AIJ9ttMHNEokLiiRF6wy7woiA0AAQVLFQ2uJj6UsWyuqx7Fch2hpTID/cHYCXO0g3Bq9leNOA6tonsSjPrUQ7OEkE/DsTo4gZnKJYSr5UG+t80wib1zhoxBcFoLgZa2R86kGXfB13hVxnmoyGsSpMZz+GaOP0WhxY3ffi6TE0o0DbSkwWGdNOV6kvCSwHIkbyN5P1twvANgsoqoVt9sRejywc92eXxgDYuW8TdB4sQEc3T/mPBtQRWt1gymLEWh4drmI4JydmsGJpOPrdvjJ899hkGAxBpnxPtonQ6UNsXhYSjJtS+ywICHm19cXmAYkU5zcNNhlUBfRE7yHOONe5Nhrx8tjIU1k98oL4Yq5sKbbN3baaBvIT2x57/v9PB9y112SgMKff3+Du6RPZnMaCPQCdzTkMtS3rRkQ5PsBjliK1ajr5QhObFaaIU9VKqpLHJNy6VI=----ATTACHMENT:----OTU4MzAyMTY1MTA0NDQ3MiA3Nzk0NDIyMTU0ODc2NjA0IDIwNjA1MTk4Mzc4MzAxOTU=