Skip to content

Commit bef374d

Browse files
Upgrade ID column in the database table to BigInteger to support large OID values. #9223
1 parent a9d5640 commit bef374d

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
##########################################################################
2+
#
3+
# pgAdmin 4 - PostgreSQL Tools
4+
#
5+
# Copyright (C) 2013 - 2026, The pgAdmin Development Team
6+
# This software is released under the PostgreSQL Licence
7+
#
8+
##########################################################################
9+
10+
"""
11+
Updated id column type to BIGINT.
12+
13+
Revision ID: 018e16dad6aa
14+
Revises: efbbe5d5862f
15+
Create Date: 2026-01-08 14:37:33.257002
16+
17+
"""
18+
import sqlalchemy as sa
19+
from alembic import op
20+
21+
# revision identifiers, used by Alembic.
22+
revision = '018e16dad6aa'
23+
down_revision = 'efbbe5d5862f'
24+
branch_labels = None
25+
depends_on = None
26+
27+
28+
def upgrade():
29+
with op.batch_alter_table("database") as batch_op:
30+
batch_op.alter_column('id',
31+
existing_type=sa.Integer(),
32+
type_=sa.BigInteger(),
33+
nullable=False)
34+
35+
36+
def downgrade():
37+
# pgAdmin only upgrades, downgrade not implemented.
38+
pass

web/pgadmin/model/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#
3434
##########################################################################
3535

36-
SCHEMA_VERSION = 48
36+
SCHEMA_VERSION = 49
3737

3838
##########################################################################
3939
#
@@ -412,7 +412,7 @@ class Database(db.Model):
412412
Define a Database.
413413
"""
414414
__tablename__ = 'database'
415-
id = db.Column(db.Integer, primary_key=True)
415+
id = db.Column(db.BigInteger, primary_key=True)
416416
schema_res = db.Column(db.String(256), nullable=True)
417417
server = db.Column(
418418
db.Integer,

0 commit comments

Comments
 (0)