Jira issue originally created by user @beberlei:
Schema should have support for triggers, views and stored procedures. Since this is not standardizable accross platforms easily, the idea is to allow arbitrary SQL DDL Statements to be registered on a Schema, maybe even qualified by platform.
$artifact = new SQLArtifact();
$artifact->create('CREATE VIEW IF NOT EXISTS foo SELECT 1');
$artifact->drop('DROP VIEW foo');
$artifact->setPlatforms("mysql"); // accepts string or array, if nothing is set applies to ALL platforms.
During the SQL generation for the schema, the following will be appended to the currently generated SQL:
DROP VIEW foo;
CREATE VIEW IF NOT EXISTS foo SELECT 1
The drop part of the statement is always rendered before the create statement in the Create Schema Visitor. In the Drop schema listener only the drop part is used.