Skip to content

Commit

Permalink
Database: Update template to latest standards rucio#7295
Browse files Browse the repository at this point in the history
* Remove UTF-8 encoding declaration
* Adjust imports to pass Ruff's check
* Remove excessive newlines
* Format docstrings according to PEP 257
  • Loading branch information
dchristidis committed Jan 8, 2025
1 parent c129f6d commit 93ad043
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions lib/rucio/db/sqla/migrate_repo/script.py.mako
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,10 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

''' ${message} '''
"""${message}""" # noqa: D400, D415

import sqlalchemy as sa

from alembic import context
from alembic.op import execute

Expand All @@ -26,34 +24,24 @@ down_revision = ${repr(down_revision)}


def upgrade():
'''
Upgrade the database to this revision
'''

"""Upgrade the database to this revision."""
schema = context.get_context().version_table_schema + '.' if context.get_context().version_table_schema else ''

if context.get_context().dialect.name == 'oracle':
pass

elif context.get_context().dialect.name == 'postgresql':
pass

elif context.get_context().dialect.name == 'mysql':
pass


def downgrade():
'''
Downgrade the database to the previous revision
'''

"""Downgrade the database to the previous revision."""
schema = context.get_context().version_table_schema + '.' if context.get_context().version_table_schema else ''

if context.get_context().dialect.name == 'oracle':
pass

elif context.get_context().dialect.name == 'postgresql':
pass

elif context.get_context().dialect.name == 'mysql':
pass

0 comments on commit 93ad043

Please sign in to comment.