wpdb = $wpdb; $this->prefix = $wpdb->prefix; $this->charset_collate = $wpdb->get_charset_collate(); } /** * Run the migration. */ abstract public function up(); /** * Reverse the migration. * * Override in concrete migrations to undo what up() did. Called by * Migrator::rollback() — never invoked automatically. * * @return void */ public function down() { // No-op by default. Override to implement rollback logic. } /** * Determine whether this migration should run. * * Override to add a custom idempotency check beyond name-based tracking. * Return false to skip the migration without recording it. * * @return bool */ public function should_run() { return true; } }