Converts a single tenant schema into a multi-tenant schema for SQL Azure Federations under the following assumptions:
- Every table is part of the multi-tenant application, only explicitly excluded tables are non-federated. The behavior of the tables being in global or federated database is undefined. It depends on you selecting a federation before DDL statements or not.
- Every Primary key of a federated table is extended by another column
'tenant_id' with a default value of the SQLAzure function
- You always have to work with
filtering=Onwhen using federations with this multi-tenant approach.
- Primary keys are either using globally unique ids (GUID, Table Generator) or you explicitly add the tenent_id in every UPDATE or DELETE statement (otherwise they will affect the same-id rows from other tenents as well). SQLAzure throws errors when you try to create IDENTIY columns on federated tables.
__construct(array $excludedTables = array(), $tenantColumnName = 'tenant_id', $distributionName = null)