Changing schema of existing versionTable

501 views
Skip to first unread message

ruben verschueren

unread,
Jul 25, 2014, 4:31:48 AM7/25/14
to fluentmigrato...@googlegroups.com
Hi guys/gals,

I want to change the schema of an existing versionInfo table, which already has about 7 migrations logged in it.
The default dbo schema should be replaced with the "core" schema
I executed following steps:
- change the schema of the versionInfo table in the database







  which is in the same project as my migrations and has the following code:
 using FluentMigrator.VersionTableInfo;

namespace Migrations
{
    [VersionTableMetaData]
    public class VersionTable : IVersionTableMetaData
    {
        public string ColumnName
        {
            get { return "Version"; }
        }

        public string DescriptionColumnName { get; private set; }

        public string SchemaName
        {
            get { return "Core"; }
        }

        public string TableName
        {
            get { return "VersionInfo"; }
        }

        public string UniqueIndexName
        {
            get { return "UC_Version"; }
        }
    }
}


now after building, when I want to execute a migration I get following error. 
I got the feeling I forgot something... anyone have any idea about what I'm missing here?

[+] Using Database SqlServer2012 and Connection String [CONNECTIONSTRING]
!!! System.NullReferenceException: Object reference not set to an instance of an object.
   at FluentMigrator.Runner.Helpers.FormatHelper.FormatSqlEscape(String sql) in c:\TeamCity\buildAgent\work\e4216861462f2d5b\src\FluentMigrator.Runner\Helpers\FormatHelper.cs:line 8
   at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.ColumnExists(String schemaName, String tableName, String columnName) in c:\TeamCity\buildAgent\work\e4216861462f2d5b\src\FluentMigrator.Runner\Processors\SqlServer\SqlServerProcessor.cs:line 75
   at FluentMigrator.Runner.VersionLoader.get_AlreadyMadeVersionDescription() in c:\TeamCity\buildAgent\work\e4216861462f2d5b\src\FluentMigrator.Runner\VersionLoader.cs:line 127
   at FluentMigrator.Runner.VersionLoader.LoadVersionInfo() in c:\TeamCity\buildAgent\work\e4216861462f2d5b\src\FluentMigrator.Runner\VersionLoader.cs:line 157
   at FluentMigrator.Runner.VersionLoader..ctor(IMigrationRunner runner, Assembly assembly, IMigrationConventions conventions) in c:\TeamCity\buildAgent\work\e4216861462f2d5b\src\FluentMigrator.Runner\VersionLoader.cs:line 43
   at FluentMigrator.Runner.MigrationRunner..ctor(Assembly assembly, IRunnerContext runnerContext, IMigrationProcessor processor) in c:\TeamCity\buildAgent\work\e4216861462f2d5b\src\FluentMigrator.Runner\MigrationRunner.cs:line 86
   at FluentMigrator.Runner.Initialization.TaskExecutor.Initialize() in c:\TeamCity\buildAgent\work\e4216861462f2d5b\src\FluentMigrator.Runner\Initialization\TaskExecutor.cs:line 53
   at FluentMigrator.Runner.Initialization.TaskExecutor.Execute() in c:\TeamCity\buildAgent\work\e4216861462f2d5b\src\FluentMigrator.Runner\Initialization\TaskExecutor.cs:line 60
   at FluentMigrator.Console.MigratorConsole.ExecuteMigrations(IAnnouncer announcer)
   at FluentMigrator.Console.MigratorConsole.ExecuteMigrations()
   at FluentMigrator.Console.MigratorConsole..ctor(String[] args) 

Tom Marien

unread,
Jul 26, 2014, 3:09:21 AM7/26/14
to fluentmigrato...@googlegroups.com
Supply the name for description column instead of get; private set, should fix your error :)
Reply all
Reply to author
Forward
0 new messages