The PostgreSqlMigrationGenerator.AlterColumn does not handle DateTimeOffSet DbType correctly. It seems to generate conversion logic that does uses DateTimeOffSet instead of the correct timestampz type. See below generated output.
-- project from authorizationdate TIMESTAMP (6) to AuthorizationDate DATETIMEOFFSET
ALTER TABLE project ALTER COLUMN AuthorizationDate TYPE DATETIMEOFFSET USING CAST(AuthorizationDate AS DATETIMEOFFSET);
ALTER TABLE project ALTER COLUMN AuthorizationDate DROP NOT NULL;
This generates the following error
ScriptExecutionError: 42704: type "datetimeoffset" does not exist
The data type in the script should be timestampz. The data type is correctly generated when using the AddColumn operation but not when changing data type.
This was an issue in my code. The table I was using to add / modify the column did not have the correct database type set on it due to a logic error in my code.
The PostgreSqlMigrationGenerator.AlterColumn does not handle DateTimeOffSet DbType correctly. It seems to generate conversion logic that does uses DateTimeOffSet instead of the correct timestampz type. See below generated output.
This generates the following error
ScriptExecutionError: 42704: type "datetimeoffset" does not exist
The data type in the script should be
timestampz
. The data type is correctly generated when using theAddColumn
operation but not when changing data type.