package com.peterphi.std.guice.liquibase.hibernate;

import liquibase.database.core.MSSQLDatabase;
import liquibase.structure.core.Schema;

/**
 * Extension to liquibase MSSQLDatabase that bypasses the prohibition on changing the default schema name
 */
class DefaultSchemaPermittingMSSQLDatabase extends MSSQLDatabase
{
	@Override
	public void setDefaultSchemaName(final String schemaName)
	{
		this.setOutputDefaultSchema(true);
		this.defaultSchemaName = correctObjectName(schemaName, Schema.class);
	}


	@Override
	public int getPriority()
	{
		return 999;
	}
}

@@ -247,16 +247,29 @@
 ame%0A */%0A
+public final 
 class De
@@ -327,16 +327,82 @@
 abase%0A%7B%0A
+%09public DefaultSchemaPermittingMSSQLDatabase()%0A%09%7B%0A%09%09super();%0A%09%7D%0A%0A%0A
 %09@Overri

Add constructor to DefaultSchemaPermittingMSSQLDatabase