1 | |
package liquibase.sqlgenerator.core; |
2 | |
|
3 | |
import liquibase.database.Database; |
4 | |
import liquibase.exception.ValidationErrors; |
5 | |
import liquibase.sql.Sql; |
6 | |
import liquibase.sql.UnparsedSql; |
7 | |
import liquibase.sqlgenerator.SqlGenerator; |
8 | |
import liquibase.sqlgenerator.SqlGeneratorChain; |
9 | |
import liquibase.statement.core.DropViewStatement; |
10 | |
|
11 | 25 | public class DropViewGenerator extends AbstractSqlGenerator<DropViewStatement> { |
12 | |
|
13 | |
public ValidationErrors validate(DropViewStatement dropViewStatement, Database database, |
14 | |
SqlGeneratorChain sqlGeneratorChain) { |
15 | 15 | ValidationErrors validationErrors = new ValidationErrors(); |
16 | 15 | validationErrors.checkRequiredField("viewName", dropViewStatement.getViewName()); |
17 | 15 | return validationErrors; |
18 | |
} |
19 | |
|
20 | |
public Sql[] generateSql(DropViewStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { |
21 | 0 | return new Sql[] { new UnparsedSql("DROP VIEW " |
22 | |
+ database.escapeViewName(statement.getSchemaName(), statement.getViewName())) }; |
23 | |
} |
24 | |
} |