Skip to content

Commit 64f02e2

Browse files
authored
Merge branch 'main' into cline
2 parents 94769f7 + 868afe6 commit 64f02e2

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

Diff for: .github/workflows/image-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
cache-to: type=gha,mode=max
9090
build-args: |
9191
LATEST_RELEASE=${{ env.LATEST_RELEASE }}
92-
CODEGATE_VERSION=${{ steps.version-string.outputs.tag }}
92+
CODEGATE_VERSION=${{ github.ref_name }}
9393
- name: Capture Image Digest
9494
id: image-digest
9595
run: |

Diff for: Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ build: clean test
3232
poetry build
3333

3434
image-build:
35+
@echo "Fetching tags to get right version number..."
36+
@git fetch -t
37+
@echo "Building container..."
3538
DOCKER_BUILDKIT=1 $(CONTAINER_BUILD) \
3639
-f Dockerfile \
3740
--build-arg LATEST_RELEASE=$(shell curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" | grep '"zipball_url":' | cut -d '"' -f 4) \

Diff for: migrations/env.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def run_migrations_offline() -> None:
3535
target_metadata=target_metadata,
3636
literal_binds=True,
3737
dialect_opts={"paramstyle": "named"},
38+
transactional_ddl=True,
3839
)
3940

4041
with context.begin_transaction():

Diff for: migrations/versions/2025_01_21_0820-4dec3e456c9e_add_on_delete_cascade.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def upgrade() -> None:
2121
# To add ON DELETE CASCADE to the foreign key constraint, we need to
2222
# rename the table, create a new table with the constraint, and copy
2323
# the data over.
24+
op.execute("DROP TABLE IF EXISTS _prompts_old;")
2425
op.execute("ALTER TABLE prompts RENAME TO _prompts_old;")
2526
op.execute(
2627
"""
@@ -39,6 +40,7 @@ def upgrade() -> None:
3940
op.execute("DROP TABLE _prompts_old;")
4041

4142
# Doing the same for the sessions table
43+
op.execute("DROP TABLE IF EXISTS _sessions_old;")
4244
op.execute("ALTER TABLE sessions RENAME TO _sessions_old;")
4345
op.execute(
4446
"""
@@ -54,6 +56,7 @@ def upgrade() -> None:
5456
op.execute("DROP TABLE _sessions_old;")
5557

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

7275
# Doing the same for the alerts table
76+
op.execute("DROP TABLE IF EXISTS _alerts_old;")
7377
op.execute("ALTER TABLE alerts RENAME TO _alerts_old;")
7478
op.execute(
7579
"""
@@ -89,7 +93,7 @@ def upgrade() -> None:
8993
op.execute("DROP TABLE _alerts_old;")
9094

9195
# Dropping unused table
92-
op.execute("DROP TABLE settings;")
96+
op.execute("DROP TABLE IF EXISTS settings;")
9397

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

0 commit comments

Comments
 (0)