Insert data into versionInfo

0

i have added fluentmigration to execute migration with my sql script :

services.AddFluentMigratorCore()
                    .ConfigureRunner(
                        builder => builder
                               .AddSqlServer()
                               .WithGlobalConnectionString(Configuration["ConnectionStrings:StarNet"])
                               .ScanIn(typeof(AjouterColonneMFI_MNT).Assembly).For.Migrations().For.EmbeddedResources());

But when i have added a script that reference different database i have got an error :

System.Exception
  HResult=0x80131500
  Message=An error occured executing the following sql:
  INSERT INTO [dbo].[VersionInfo] ([Version], [AppliedOn], [Description]) VALUES (20200226120430, '2020- 
  02-27T13:27:34', N'TestDatabase')
   The error was object name 'dbo.VersionInfo' invalid.

here is my sql script that reference my first database'DEV_SHIVA', and another database 'DEV_OFFICE' :

USE [DEV_SHIVA]
GO

CREATE SYNONYM [dbo].[SYN_OFFICE_DN_ACADOMIA_GetInterventionByIntervenantId] FOR [DEV_OFFICE].[dbo].[DN_ACADOMIA_GetInterventionByIntervenantId]
GO                                         

CREATE PROCEDURE [dbo].[DN_OFFICE_GetInterventionByIntervenantId]
       @INTERVENANT_BO_ID int
AS
BEGIN
SOME script

END
GO

USE [DEV_OFFICE]
GO



GRANT EXECUTE ON [dbo].[DN_ACADOMIA_GetInterventionByIntervenantId] TO [DOMIAGROUP\StarNet]
GO
GRANT EXECUTE ON [dbo].[DN_ACADOMIA_GetInterventionByIntervenantId] TO [StarNet]
GO

Do you have any suggestion to how i can do migration when i have multiple database

c#
sql-server
.net-core
fluent-migrator
asked on Stack Overflow Feb 27, 2020 by ucef • edited Feb 27, 2020 by ucef

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0