Back to home page

EIC code displayed by LXR

 
 

    


Warning, /iDDS/main/lib/idds/orm/base/alembic/script.py.mako is written in an unsupported language. File is not indexed.

0001 #!/usr/bin/env python
0002 #
0003 # Licensed under the Apache License, Version 2.0 (the "License");
0004 # You may not use this file except in compliance with the License.
0005 # You may obtain a copy of the License at
0006 # http://www.apache.org/licenses/LICENSE-2.0OA
0007 #
0008 # Authors:
0009 # - Wen Guan, <wen.guan@cern.ch>, 2025
0010 
0011 """${message}
0012 
0013 Revision ID: ${up_revision}
0014 Revises: ${down_revision | comma,n}
0015 Create Date: ${create_date}
0016 
0017 """
0018 from alembic import op
0019 from alembic import context
0020 import sqlalchemy as sa
0021 ${imports if imports else ""}
0022 
0023 # revision identifiers, used by Alembic.
0024 revision = ${repr(up_revision)}
0025 down_revision = ${repr(down_revision)}
0026 branch_labels = ${repr(branch_labels)}
0027 depends_on = ${repr(depends_on)}
0028 
0029 
0030 def upgrade() -> None:
0031     if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']:
0032         schema = context.get_context().version_table_schema if context.get_context().version_table_schema else ''
0033         ${upgrades if upgrades else "pass"}
0034 
0035 
0036 def downgrade() -> None:
0037     if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']:
0038         schema = context.get_context().version_table_schema if context.get_context().version_table_schema else ''
0039         ${downgrades if downgrades else "pass"}