Skip to content

Commit 9212d37

Browse files
committed
Alembic migration for tool annotations and MANIFEST update
Signed-off-by: Madhav Kandukuri <[email protected]>
1 parent 40c0dcd commit 9212d37

File tree

3 files changed

+46
-71
lines changed

3 files changed

+46
-71
lines changed

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ include gunicorn.config.py
1010
include Containerfile
1111
include Containerfile.lite
1212
include __init__
13+
include alembic.ini
14+
include tox.ini
1315

1416
# 2️⃣ Top-level config, examples and helper scripts
1517
include *.py
@@ -43,6 +45,11 @@ recursive-include mcpgateway/templates *.html
4345
recursive-include mcpgateway/static *.css *.js *.gif *.png *.svg
4446
recursive-include mcpgateway *.pyi py.typed
4547
recursive-include mcpgateway *.ico
48+
recursive-include alembic *.mako
49+
recursive-include alembic *.md
50+
recursive-include alembic *.py
51+
recursive-include deployment *
52+
recursive-include mcp-servers *
4653

4754
# 5️⃣ (Optional) include MKDocs-based docs in the sdist
4855
graft docs

alembic/README

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""Add annotations to tables
2+
3+
Revision ID: e4fc04d1a442
4+
Revises: b77ca9d2de7e
5+
Create Date: 2025-06-27 21:45:35.099713
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
import sqlalchemy as sa
11+
12+
from alembic import op
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = 'e4fc04d1a442'
16+
down_revision: Union[str, Sequence[str], None] = 'b77ca9d2de7e'
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
"""
23+
Applies the migration to add the 'annotations' column.
24+
25+
This function adds a new column named 'annotations' of type JSON to the 'tool'
26+
table. It includes a server-side default of an empty JSON object ('{}') to ensure
27+
that existing rows get a non-null default value.
28+
"""
29+
op.add_column('tools', sa.Column('annotations', sa.JSON(), server_default=sa.text("'{}'"), nullable=False))
30+
31+
32+
def downgrade() -> None:
33+
"""
34+
Reverts the migration by removing the 'annotations' column.
35+
36+
This function provides a way to undo the migration, safely removing the
37+
'annotations' column from the 'tool' table.
38+
"""
39+
op.drop_column('tools', 'annotations')

0 commit comments

Comments
 (0)