Customise schema/object name of the MigrationLog table

edited February 16, 2017 12:48AM in ReadyRoll
Is it possible to configure a ReadyRoll project to use a __MigrationLog table in a schema other than dbo, so that more than one application could manage and version control its database schema within a shared database?

Alternatively, is it possible to use a table named something other than __MigrationLog, to the same end?

Apologies if this is documented somewhere; I have tried to find an answer, and failed.

-Mark Davies
Daniel Nolan
Product Manager, ReadyRoll
Redgate Software

Comments

  • edited April 20, 2017 10:29AM
    It is indeed possible to deploy the [dbo].[__MigrationLog] table to an alternative schema (i.e. other than dbo).

    In order to set a custom schema name, edit your project file (.sqlproj) and add the following under the root node:
    <PropertyGroup> 
       <MigrationLogSchemaName>MySchema</MigrationLogSchemaName>
    </PropertyGroup>
    
    The next time you deploy your project, the migration log table will be created within the specified schema (as will the related view object, [MigrationLogCurrent]).

    (Incidentally, if you're looking to split your shared database into multiple projects (i.e. so that each project only includes the objects from a specific schema), have a look at the following forum post to find out how to setup project filters:
    viewtopic.php?f=199&t=80015 )

    It is also possible to customise the table name (default: __MigrationLog) and view name (default: __MigrationLogCurrent):
    <PropertyGroup> 
       <MigrationLogTableName>MyMigrationLog</MigrationLogTableName>
       <MigrationLogViewName>MyMigrationLogCurrent</MigrationLogViewName>
    </PropertyGroup>
    
    Daniel Nolan
    Product Manager, ReadyRoll
    Redgate Software
Sign In or Register to comment.