Skip to content

Commit de7d19b

Browse files
committed
Make job id sequence altering compatible with new as well as old postgres
1 parent 306e9d6 commit de7d19b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/Hangfire.PostgreSql/Hangfire.PostgreSql.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
<PackageReleaseNotes>https://github.com/frankhommers/Hangfire.PostgreSql/releases</PackageReleaseNotes>
1515
<PackageProjectUrl>http://hmm.rs/Hangfire.PostgreSql</PackageProjectUrl>
1616
<PackageLicenseUrl></PackageLicenseUrl>
17-
<Version>1.8.5.0</Version>
18-
<FileVersion>1.8.5.0</FileVersion>
19-
<AssemblyVersion>1.8.5.0</AssemblyVersion>
17+
<Version>1.8.5.1</Version>
18+
<FileVersion>1.8.5.1</FileVersion>
19+
<AssemblyVersion>1.8.5.1</AssemblyVersion>
2020
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
2121
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
2222
<RepositoryUrl>https://github.com/frankhommers/Hangfire.PostgreSql</RepositoryUrl>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
SET search_path = 'hangfire';
22

3-
4-
53
DO
64
$$
75
BEGIN
@@ -11,6 +9,14 @@ BEGIN
119
END
1210
$$;
1311

14-
ALTER SEQUENCE job_id_seq MAXVALUE 9223372036854775807;
12+
do
13+
$$
14+
DECLARE
15+
BEGIN
16+
EXECUTE('ALTER SEQUENCE ' || 'hangfire' || '.job_id_seq AS bigint MAXVALUE 9223372036854775807');
17+
EXCEPTION WHEN syntax_error THEN
18+
EXECUTE('ALTER SEQUENCE ' || 'hangfire' || '.job_id_seq MAXVALUE 9223372036854775807');
19+
END;
20+
$$;
1521

1622
RESET search_path;

0 commit comments

Comments
 (0)