Skip to content

Commit

Permalink
Merge branch 'main' into cline
Browse files Browse the repository at this point in the history
  • Loading branch information
yrobla authored Jan 22, 2025
2 parents 94769f7 + 868afe6 commit 64f02e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
cache-to: type=gha,mode=max
build-args: |
LATEST_RELEASE=${{ env.LATEST_RELEASE }}
CODEGATE_VERSION=${{ steps.version-string.outputs.tag }}
CODEGATE_VERSION=${{ github.ref_name }}
- name: Capture Image Digest
id: image-digest
run: |
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ build: clean test
poetry build

image-build:
@echo "Fetching tags to get right version number..."
@git fetch -t
@echo "Building container..."
DOCKER_BUILDKIT=1 $(CONTAINER_BUILD) \
-f Dockerfile \
--build-arg LATEST_RELEASE=$(shell curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" | grep '"zipball_url":' | cut -d '"' -f 4) \
Expand Down
1 change: 1 addition & 0 deletions migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def run_migrations_offline() -> None:
target_metadata=target_metadata,
literal_binds=True,
dialect_opts={"paramstyle": "named"},
transactional_ddl=True,
)

with context.begin_transaction():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def upgrade() -> None:
# To add ON DELETE CASCADE to the foreign key constraint, we need to
# rename the table, create a new table with the constraint, and copy
# the data over.
op.execute("DROP TABLE IF EXISTS _prompts_old;")
op.execute("ALTER TABLE prompts RENAME TO _prompts_old;")
op.execute(
"""
Expand All @@ -39,6 +40,7 @@ def upgrade() -> None:
op.execute("DROP TABLE _prompts_old;")

# Doing the same for the sessions table
op.execute("DROP TABLE IF EXISTS _sessions_old;")
op.execute("ALTER TABLE sessions RENAME TO _sessions_old;")
op.execute(
"""
Expand All @@ -54,6 +56,7 @@ def upgrade() -> None:
op.execute("DROP TABLE _sessions_old;")

# Doing the same for the output table
op.execute("DROP TABLE IF EXISTS _outputs_old;")
op.execute("ALTER TABLE outputs RENAME TO _outputs_old;")
op.execute(
"""
Expand All @@ -70,6 +73,7 @@ def upgrade() -> None:
op.execute("DROP TABLE _outputs_old;")

# Doing the same for the alerts table
op.execute("DROP TABLE IF EXISTS _alerts_old;")
op.execute("ALTER TABLE alerts RENAME TO _alerts_old;")
op.execute(
"""
Expand All @@ -89,7 +93,7 @@ def upgrade() -> None:
op.execute("DROP TABLE _alerts_old;")

# Dropping unused table
op.execute("DROP TABLE settings;")
op.execute("DROP TABLE IF EXISTS settings;")

# Create indexes for foreign keys
op.execute("CREATE INDEX idx_outputs_prompt_id ON outputs(prompt_id);")
Expand Down

0 comments on commit 64f02e2

Please sign in to comment.