Skip to content

Commit

Permalink
Prefer IDENTITY column to SERIAL
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagomota committed Nov 11, 2021
1 parent 4811cbf commit 4943904
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ DROP FUNCTION IF EXISTS public.update_journal_persistence_ids();
DROP TABLE IF EXISTS public.journal_persistence_ids;

CREATE TABLE public.journal_persistence_ids(
id BIGSERIAL,
id BIGINT GENERATED ALWAYS AS IDENTITY,
persistence_id TEXT NOT NULL,
max_sequence_number BIGINT NOT NULL,
min_ordering BIGINT NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ DROP FUNCTION IF EXISTS public.update_journal_persistence_ids();
DROP TABLE IF EXISTS public.journal_persistence_ids;

CREATE TABLE public.journal_persistence_ids(
id BIGSERIAL,
id BIGINT GENERATED ALWAYS AS IDENTITY,
persistence_id TEXT NOT NULL,
max_sequence_number BIGINT NOT NULL,
min_ordering BIGINT NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/resources/schema/postgres/plain-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ DROP FUNCTION IF EXISTS public.update_journal_persistence_ids();
DROP TABLE IF EXISTS public.journal_persistence_ids;

CREATE TABLE public.journal_persistence_ids(
id BIGSERIAL,
id BIGINT GENERATED ALWAYS AS IDENTITY,
persistence_id TEXT NOT NULL,
max_sequence_number BIGINT NOT NULL,
min_ordering BIGINT NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private[journal] trait JournalSchema {
import journalPersistenceIdsTableCfg.columnNames._
for {
_ <- sqlu"""CREATE TABLE #$fullTableName (
#$id BIGSERIAL,
#$id BIGINT GENERATED ALWAYS AS IDENTITY,
#$persistenceId TEXT NOT NULL,
#$maxSequenceNumber BIGINT NOT NULL,
#$maxOrdering BIGINT NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BEGIN

sql := 'CREATE TABLE IF NOT EXISTS ' || jpi_table ||
'(' ||
jpi_id_column || ' BIGSERIAL, ' ||
jpi_id_column || ' BIGINT GENERATED ALWAYS AS IDENTITY, ' ||
jpi_persistence_id_column || ' TEXT NOT NULL, ' ||
jpi_max_sequence_number_column || ' BIGINT NOT NULL, ' ||
jpi_max_ordering_column || ' BIGINT NOT NULL, ' ||
Expand Down

0 comments on commit 4943904

Please sign in to comment.