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:----eDAo0IUUg3Id1mcLAYcWgZ/i/3nnIV+JpmjEKfk61SA1ZmZc/U6VlwzRXyKGkwdSDrf3AgIvSapEagJJDcA/ew4d87go+sk4ay8j40GXSn2vuzHvaDzadSkgtvGUavsn3uHSEYQ64rp45OhS6o/SmBsS66fjSou8MMx3g1H3eLTEoxzizSWEiEmD9BmxeCPjhNCL1X2PMB6eBSeRiva/62NuYnBv59kTTIJtR6hkpUyOQ+T7Z4hsN2Rs+AzN2RrnjXn5DdfeEUrrx2sa59Q16V8JgQnPGlkeALmGHwl74omXC/SFgpWu88kCtRADBZfQQk/yfp/MbvXZYhRx5XCICeWxzqnLBzNzJn/CeNO11HgGaiJqmsLI0eYRoCqQybJGXGt24rluN6D+LjLZxgydEZO/fSAnoFta649g2iZ2F9Go6W6tqdN8syC/2AIhvA7qpQ2jG8h/YJagt9/2yq2NVkdrXi38e0aSdZfrNmEudwf7mZtCE6ucWqOhuBb8z387Tx0+zvrMRSIdqAanC+LGriFUIrI3pSQA8ORcn1aOQFOU0i+xB6VlmiJvACrt25OAx4ssvsj0Rd5Dp23kVO87Mjovb6axrFCTDoTjRjGuP5pWNcV7xUPL8dJYtFqW0iZ5IcwVTVqAgNxCdjJuuUByWleC8f0kYpKJaOKmioNJ3X8=----ATTACHMENT:----NDQxMDgyODMwNDk2NzY4NSAxNjEyMTkwMjMyODEwMDYgMTkwNTY0ODk5NTk2OTM5Nw==