sqlserver2pgsql icon indicating copy to clipboard operation
sqlserver2pgsql copied to clipboard

Can't migrate triggers

Open AntoninPerrot opened this issue 1 year ago • 0 comments

Hello,

While using your tool (pretty great btw), problems with triggers occurred :

Warning: Trigger dbo].[OnDelRun ignored
Line <ALTER TABLE [dbo].[Run] ENABLE TRIGGER [OnDelRun]
> (2530) not understood. This is a bug at sqlserver2pgsql.pl line 2551, <$file> line 2530.

Here is a sample of the migration script :

...
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO


CREATE TRIGGER [dbo].[OnDelRun]
    ON [dbo].[Run]
    FOR DELETE
    AS
    BEGIN
		DISABLE TRIGGER [dbo].[OnInsUpdRun] ON [dbo].[Run];
		DISABLE TRIGGER [dbo].[OnInsUpdRunAnalysis] ON [dbo].[RunAnalysis];

		.......

		ENABLE TRIGGER [dbo].[OnInsUpdRun] ON [dbo].[Run];
		ENABLE TRIGGER [dbo].[OnInsUpdRunAnalysis] ON [dbo].[RunAnalysis];
    END
GO
ALTER TABLE [dbo].[Run] ENABLE TRIGGER [OnDelRun] 
GO
/****** Object:  Trigger [dbo].[OnInsUpdRun]    Script Date: 16/06/2023 09:50:58 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
....

Is there something particular to do or an option to activate ? Thanks, Antonin

AntoninPerrot avatar Jun 16 '23 07:06 AntoninPerrot