validateMigration example

$file = $migrationPath . '/' . $result['0'];
            require $file;
        }

        try {
            /** @var AbstractMigration $migrationClass */
            $migrationClass = new $migrationClassName($this->getConnection());
        } catch (Exception $e) {
            throw new RuntimeException(sprintf('Could not instantiate Object of class "%s"', $migrationClassName));
        }

        $this->validateMigration($migrationClass$result);

        return $migrationClass;
    }

    protected function insertMigration(AbstractMigration $migration): void
    {
        $sql = 'REPLACE s_schema_version (version, start_date, name) VALUES (:version, :date, :name)';
        $stmt = $this->connection->prepare($sql);
        $stmt->execute([
            ':version' => $migration->getVersion(),
            ':date' => date('Y-m-d H:i:s'),
            
$file = $migrationPath . '/' . $result['0'];
            require $file;
        }

        try {
            /** @var AbstractPluginMigration $migrationClass */
            $migrationClass = new $migrationClassName($this->getConnection());
        } catch (Exception $e) {
            throw new Exception('Could not instantiate Object');
        }

        $this->validateMigration($migrationClass$result);

        return $migrationClass;
    }

    protected function insertMigration(AbstractMigration $migration): void
    {
        $sql = 'REPLACE s_plugin_schema_version (plugin_name, version, start_date, name) VALUES (:plugin_name, :version, :date, :name)';
        $stmt = $this->connection->prepare($sql);
        $stmt->execute([
            ':plugin_name' => $this->plugin->getName(),
            ':version' => $migration->getVersion(),
            
Home | Imprint | This part of the site doesn't use cookies.