Skip to content

Commit

Permalink
Add autoincrement=false to some columns (DM-43097)
Browse files Browse the repository at this point in the history
Columns which are primary keys by default have autioncrement=auto
in sqlalchemy which for single-column PK enables autoincrement.
This does no big harm for APDB schema but creates unnecessary
sequences in postgres. To avoid those extra sequences I mark all
integer PK columns as autoincrement=false.
  • Loading branch information
andy-slac committed Apr 12, 2024
1 parent 6851200 commit 62c2087
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yml/apdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ tables:
"@id": "#SSObject.ssObjectId"
datatype: long
nullable: false
autoincrement: false
description: Unique identifier.
mysql:datatype: BIGINT
ivoa:ucd: meta.id;src
Expand Down Expand Up @@ -1587,6 +1588,7 @@ tables:
"@id": "#DiaSource.diaSourceId"
datatype: long
nullable: false
autoincrement: false
description: Unique identifier of this DiaSource.
mysql:datatype: BIGINT
ivoa:ucd: meta.id;obs.image
Expand Down Expand Up @@ -2496,6 +2498,7 @@ tables:
"@id": "#DiaObjectLast.diaObjectId"
datatype: long
nullable: false
autoincrement: false
description: Unique id.
ivoa:ucd: meta.id;src
- name: lastNonForcedSource
Expand Down Expand Up @@ -2809,6 +2812,7 @@ tables:
- name: ssObjectId
"@id": "#SSSource.ssObjectId"
datatype: long
autoincrement: false
description: Unique identifier of the object.
mysql:datatype: BIGINT
ivoa:ucd: meta.id;src
Expand Down

0 comments on commit 62c2087

Please sign in to comment.