'{prefix}twofas_migrations', ); /** * @return string */ protected function introduced() { return '2.4.0'; } /** * @throws Migration_Exception */ public function up() { $charset_collate = $this->db->get_charset_collate(); $query = "CREATE TABLE IF NOT EXISTS {$this->tables[ self::TABLE_MIGRATIONS ]} ( migration VARCHAR(100), PRIMARY KEY (migration) ) ENGINE = INNODB {$charset_collate}"; $result = $this->db->query( $query ); if ( false === $result ) { throw new Migration_Exception( 'Table ' . $this->tables[ self::TABLE_MIGRATIONS ] . ' could not be created.' ); } } /** * @throws Migration_Exception */ public function down() { $result = $this->db->query( 'DROP TABLE IF EXISTS ' . $this->tables[ self::TABLE_MIGRATIONS ] ); if ( false === $result ) { throw new Migration_Exception( 'Table ' . $this->tables[ self::TABLE_MIGRATIONS ] . ' could not be deleted.' ); } } }