Esempio n. 1
0
 /**
  * @return true if this migration is applied
  */
 function isApplied(Connection $db)
 {
     // don't error if we don't have any migration parent table
     if (!Migration::$checked_migrations_table) {
         $base = new BaseMigration();
         Migration::$checked_migrations_table = $base->isApplied($db);
     }
     if (!Migration::$checked_migrations_table) {
         return false;
     }
     $q = $db->prepare("SELECT * FROM migrations WHERE name=?");
     $q->execute(array($this->getName()));
     if ($q->fetch()) {
         return true;
     } else {
         return false;
     }
 }