rdagumampan / yuniql

Free and open source schema versioning and database migration made natively with .NET/6. NEW THIS MAY 2022! v1.3.15 released!
https://yuniql.io
Apache License 2.0
419 stars 64 forks source link

yuniql postgresql gis extenstion #295

Open dnyandeobharambe opened 1 year ago

dnyandeobharambe commented 1 year ago

I am trying to deploy postgresql script where it have geospatial data . So it use corresponding data types. But it seems Yuniql does not support it and fail with following error

SqlState: 42704
MessageText: type "geometry" does not exist
Position: 138
File: parse_type.c
Line: 275
Routine: typenameType

--- End of inner exception stack trace --- at Yuniql.Core.MigrationService.RunVersionSqlScripts(IDbConnection connection, IDbTransaction transaction, TransactionContext transactionContext, Stopwatch stopwatch, String version, String workspace, String scriptDirectory, String metaSchemaName, String metaTableName, List1 tokens, Nullable1 commandTimeout, String environment, String appliedByTool, String appliedByToolVersion) at Yuniql.Core.MigrationService.<>cDisplayClass12_0.gRunVersionDirectoriesInternal|8(IDbConnection connection, IDbTransaction transaction, List`1 scriptSubDirectories, String scriptDirectory, String versionDirectory, Stopwatch stopwatch) at Yuniql.Core.MigrationService.<>cDisplayClass12_0.b7(<>fAnonymousType02 version) at System.Collections.Generic.List1.ForEach(Action1 ) at Yuniql.Core.MigrationService.RunVersionDirectories(IDbConnection connection, IDbTransaction transaction, List1 appliedVersions, String workspace, String targetVersion, TransactionContext transactionContext, List1 tokens, String bulkSeparator, String metaSchemaName, String metaTableName, Nullable1 commandTimeout, Nullable`1 bulkBatchSize, String appliedByTool, String appliedByToolVersion, String environment, String transactionMode) at Yuniql.Core.MigrationService.gRunAllInternal|11_3(IDbConnection connection, IDbTransaction transaction, Boolean isRequiredClearedDraft, <>c__DisplayClass11_0& ) at Yuniql.Core.MigrationService.Run(String workspace, String targetVersion, Nullable1 isAutoCreateDatabase, List1 tokens, Nullable1 isVerifyOnly, String bulkSeparator, String metaSchemaName, String metaTableName, Nullable1 commandTimeout, Nullable1 bulkBatchSize, String appliedByTool, String appliedByToolVersion, String environment, Nullable1 isContinueAfterFailure, String transactionMode, Boolean isRequiredClearedDraft) at Yuniql.Core.MigrationService.Run() at Yuniql.CLI.CommandLineService.RunRunOption(RunOption opts) If you think this is a bug, please report an issue here https://github.com/rdagumampan/yuniql/issues.

yuniql/error: The process 'C:\hostedtoolcache\windows\yuniql\0.0.0\x64\yuniql.exe' failed with exit code 1

[error]The process 'C:\hostedtoolcache\windows\yuniql\0.0.0\x64\yuniql.exe' failed with exit code 1

Finishing: RunYuniqlCLI

DavidPavlicek commented 1 year ago

I have no problem with migration scripts containing PostGIS geomtery type. It looks like postgres does not know about geometry type. Did you enable PosGIS extension inside that database (create extension postgis;)?

dnyandeobharambe commented 1 year ago

Yes GIS extension is enabled

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: David Pavlíček @.> Sent: Tuesday, March 28, 2023 10:17:57 PM To: rdagumampan/yuniql @.> Cc: dnyandeobharambe @.>; Author @.> Subject: Re: [rdagumampan/yuniql] yuniql postgresql gis extenstion (Issue #295)

I have no problem with migration scripts containing PostGIS geomtery type. It looks like postgres does not know about geometry type. Did you enable PosGIS extension inside that database (create extension postgis;)?

— Reply to this email directly, view it on GitHubhttps://github.com/rdagumampan/yuniql/issues/295#issuecomment-1487960602, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJJWEPESM2I5SZL4URHTQG3W6PAYLANCNFSM6AAAAAAWBXAZUI. You are receiving this because you authored the thread.Message ID: @.***>

DavidPavlicek commented 1 year ago

Can yuniql user acces postgis function and types? If you login into database as the same user, can you select 'POINT(1 1)'::geometry?

dnyandeobharambe commented 1 year ago

let me check

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: David Pavlíček @.> Sent: Wednesday, March 29, 2023 1:25:59 PM To: rdagumampan/yuniql @.> Cc: dnyandeobharambe @.>; Author @.> Subject: Re: [rdagumampan/yuniql] yuniql postgresql gis extenstion (Issue #295)

Can yuniql user acces postgis function and types? If you login into database as the same user, can you select 'POINT(1 1)'::geometry?

— Reply to this email directly, view it on GitHubhttps://github.com/rdagumampan/yuniql/issues/295#issuecomment-1489258474, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJJWEPEOKAFWMRDLFE7KVN3W6SLFPANCNFSM6AAAAAAWBXAZUI. You are receiving this because you authored the thread.Message ID: @.***>

dnyandeobharambe commented 1 year ago

I check and saw some weird,instance I set in azure with gis,show all gis data type like polygon,point but not geometry,that could be issue as data type of table I am creating is geometry

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: dny bha @.> Sent: Wednesday, March 29, 2023 4:02:35 PM To: rdagumampan/yuniql @.>; rdagumampan/yuniql @.> Cc: Author @.> Subject: Re: [rdagumampan/yuniql] yuniql postgresql gis extenstion (Issue #295)

let me check

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: David Pavlíček @.> Sent: Wednesday, March 29, 2023 1:25:59 PM To: rdagumampan/yuniql @.> Cc: dnyandeobharambe @.>; Author @.> Subject: Re: [rdagumampan/yuniql] yuniql postgresql gis extenstion (Issue #295)

Can yuniql user acces postgis function and types? If you login into database as the same user, can you select 'POINT(1 1)'::geometry?

— Reply to this email directly, view it on GitHubhttps://github.com/rdagumampan/yuniql/issues/295#issuecomment-1489258474, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJJWEPEOKAFWMRDLFE7KVN3W6SLFPANCNFSM6AAAAAAWBXAZUI. You are receiving this because you authored the thread.Message ID: @.***>

dnyandeobharambe commented 1 year ago

Thanks It was issue with extensions, I reenable it and it works well

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: dny bha @.> Sent: Wednesday, March 29, 2023 8:22:30 PM To: rdagumampan/yuniql @.>; rdagumampan/yuniql @.> Cc: Author @.> Subject: Re: [rdagumampan/yuniql] yuniql postgresql gis extenstion (Issue #295)

I check and saw some weird,instance I set in azure with gis,show all gis data type like polygon,point but not geometry,that could be issue as data type of table I am creating is geometry

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: dny bha @.> Sent: Wednesday, March 29, 2023 4:02:35 PM To: rdagumampan/yuniql @.>; rdagumampan/yuniql @.> Cc: Author @.> Subject: Re: [rdagumampan/yuniql] yuniql postgresql gis extenstion (Issue #295)

let me check

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: David Pavlíček @.> Sent: Wednesday, March 29, 2023 1:25:59 PM To: rdagumampan/yuniql @.> Cc: dnyandeobharambe @.>; Author @.> Subject: Re: [rdagumampan/yuniql] yuniql postgresql gis extenstion (Issue #295)

Can yuniql user acces postgis function and types? If you login into database as the same user, can you select 'POINT(1 1)'::geometry?

— Reply to this email directly, view it on GitHubhttps://github.com/rdagumampan/yuniql/issues/295#issuecomment-1489258474, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJJWEPEOKAFWMRDLFE7KVN3W6SLFPANCNFSM6AAAAAAWBXAZUI. You are receiving this because you authored the thread.Message ID: @.***>