Skip to content
Snippets Groups Projects
Commit 7dc3a0e9 authored by Neda Moeini's avatar Neda Moeini Committed by Karel van Klink
Browse files

Add the GA_ID and GS_ID sequence to manage automatic creation of GA and GS ids

parent 75daa1e2
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !324. Comments created here will be created in the context of that merge request.
"""Add GS and GA sequences.
Revision ID: 79192e72131c
Revises: e36b3bd8a45c
Create Date: 2024-12-05 11:11:41.048264
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '79192e72131c'
down_revision = 'e36b3bd8a45c'
branch_labels = None
depends_on = None
def upgrade() -> None:
# Create GS ID sequence
op.execute("""
CREATE SEQUENCE gs_id_seq
START WITH 50000
INCREMENT BY 1
MINVALUE 50000
MAXVALUE 99999
NO CYCLE;
""")
# Create GA ID sequence
op.execute("""
CREATE SEQUENCE ga_id_seq
START WITH 50000
INCREMENT BY 1
MINVALUE 50000
MAXVALUE 99999
NO CYCLE;
""")
def downgrade() -> None:
op.execute("DROP SEQUENCE gs_id_seq")
op.execute("DROP SEQUENCE ga_id_seq")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment