dalibo / sqlserver2pgsql

Migration tool to convert a Microsoft SQL Server Database into a PostgreSQL database, as automatically as possible
http://dalibo.github.io/sqlserver2pgsql
GNU General Public License v3.0
515 stars 117 forks source link

Can't migrate triggers #178

Open AntoninPerrot opened 1 year ago

AntoninPerrot commented 1 year ago

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