I am encountering an issue while using Hangfire with PostgreSQL where schema installation fails with the following error:
Hangfire attempts to re-run schema migration scripts, which include ALTER TABLE ADD COLUMN statements without checking if the column already exists. PostgreSQL throws an error when trying to add a duplicate column.
Version : Hangfire.PostgreSql V. 1.21.1
Exception :
column "updatecount" of relation "lock" already exists at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult() at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteNonQuery() at Hangfire.PostgreSql.PostgreSqlObjectsInstaller.Install(NpgsqlConnection connection, String schemaName) Exception data: Severity: ERROR SqlState: 42701 MessageText: column "updatecount" of relation "lock" already exists File: tablecmds.c Line: 7686 Routine: check_for_column_name_collision
I am encountering an issue while using Hangfire with PostgreSQL where schema installation fails with the following error:
Hangfire attempts to re-run schema migration scripts, which include ALTER TABLE ADD COLUMN statements without checking if the column already exists. PostgreSQL throws an error when trying to add a duplicate column.
Version : Hangfire.PostgreSql V. 1.21.1
Exception :
column "updatecount" of relation "lock" already exists at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult() at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteNonQuery() at Hangfire.PostgreSql.PostgreSqlObjectsInstaller.Install(NpgsqlConnection connection, String schemaName) Exception data: Severity: ERROR SqlState: 42701 MessageText: column "updatecount" of relation "lock" already exists File: tablecmds.c Line: 7686 Routine: check_for_column_name_collision