Skip to content

refactor(oracle): use existing CONVERSATIONS table in Flyway test schema - #627

Merged
key4ng merged 5 commits into
mainfrom
keyang/db-migration
Mar 5, 2026
Merged

key4ng merged 5 commits into
mainfrom
keyang/db-migration

Conversation

@key4ng

@key4ng key4ng commented Mar 4, 2026 •

Copy link
Copy Markdown
Member

Description

Problem

The Flyway test migrations create a separate CONVERSATIONS_V2 table, but in production the existing CONVERSATIONS table (with CONVERSATION_ID as the primary key) is already available and should be reused directly.

Solution

Move the CONVERSATIONS table DDL into V1 alongside RESPONSES to reflect the actual production baseline, and update the schema-config to remap SMG's logical id column to the physical CONVERSATION_ID column.

Changes

  • scripts/oracle_flyway/schema-config.yaml: Point conversations at CONVERSATIONS table instead of CONVERSATIONS_V2, add id: CONVERSATION_ID column mapping
  • scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql: Renamed from V1__Create_responses_table.sql, added full CONVERSATIONS table DDL matching the production schema
  • scripts/oracle_flyway/sql/V2__Create_conversation_items_and_alter_responses.sql: Renamed from V2__Create_v2_conversations_and_alter_responses.sql, removed CONVERSATIONS_V2 DDL (now in V1)

Summary by CodeRabbit

  • Database Updates

    • Consolidated conversation schema and established baseline tables for conversations and responses
    • Added EXPIRES_AT column with a default timestamp for automatic expiration
    • Added SAFETY_IDENTIFIER to response records for tracking
    • Removed legacy V2 conversation definition, refreshed table layout, indexes, and constraints for reliability and query performance
    • Introduced conversation item tables and linking structures
  • Chores

    • CI workflow updated to trigger on database migration path changes

@coderabbitai

coderabbitai Bot commented Mar 4, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 894f6960-f1d2-4e73-9fe2-5b08c6d8aee9

📥 Commits

Reviewing files that changed from the base of the PR and between 510aad4 and 6a83e39.

📒 Files selected for processing (1)
  • .github/workflows/pr-test-rust.yml

📝 Walkthrough

Walkthrough

Refactors Oracle Flyway migrations: adds a V1 baseline that creates RESPONSES and CONVERSATIONS, renames conversations.table from CONVERSATIONS_V2 → CONVERSATIONS in schema-config, adds public id mapping and EXPIRES_AT extra column, removes standalone RESPONSES DDL, and reorders V2 to focus on conversation items while adding SAFETY_IDENTIFIER to RESPONSES.

Changes

Cohort / File(s) Summary
Schema config
scripts/oracle_flyway/schema-config.yaml
Changed conversations.table from CONVERSATIONS_V2 → CONVERSATIONS; added public mapping conversations.columns.id → CONVERSATION_ID; added conversations.extra_columns.EXPIRES_AT (TIMESTAMP WITH TIME ZONE, default value).
V1 baseline (new)
scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql
Added consolidated V1 migration creating RESPONSES and CONVERSATIONS with columns (including EXPIRES_AT), primary keys, check constraint on VERSION, and supporting indexes.
Removed/modified migrations
scripts/oracle_flyway/sql/V1__Create_responses_table.sql, scripts/oracle_flyway/sql/V2__Create_conversation_items_and_alter_responses.sql
Removed standalone RESPONSES DDL from old V1; removed CONVERSATIONS_V2 creation from V2 and reordered/renamed V2 sections; added SAFETY_IDENTIFIER column to RESPONSES.
CI workflow filter
.github/workflows/pr-test-rust.yml
Expanded detect-changes path filters to include scripts/oracle_flyway/** so changes under Oracle Flyway scripts trigger the agentic pipeline.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • slin1237
  • XinyueZhang369

Poem

🐰 I hopped through YAML and SQL with glee,
Merged tables, mapped ids, set expiry,
V1 now hums with RESPONSES and CONVERSATIONS bright,
V2 tends items through the starry night,
A carrot-coded schema — swift and light!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: refactoring the Oracle Flyway test schema to use the existing CONVERSATIONS table instead of CONVERSATIONS_V2.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch keyang/db-migration

Comment @coderabbitai help to get the list of available commands and usage tips.

@key4ng key4ng changed the title feat(database): update schema for conversations and responses refactor(oracle): use existing CONVERSATIONS table in Flyway test schema Mar 4, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on refactoring the Oracle database schema to improve organization and scalability. It involves renaming tables, adding columns, creating new SQL files for baseline schema setup, and streamlining the migration process by removing obsolete scripts. The changes enhance the database structure for future development.

Highlights

  • Database Refactoring: The pull request refactors the Oracle database schema for better organization and future scalability.
  • Table Renaming and Column Addition: Renamed the CONVERSATIONS_V2 table to CONVERSATIONS and added a new column CONVERSATION_ID.
  • Baseline Schema Creation: Created a new SQL file to establish the RESPONSES and CONVERSATIONS tables as part of the baseline schema.
  • Migration Streamlining: Deleted the old RESPONSES table creation script to streamline the migration process.
  • Enhanced Table Structure: Introduced a new SQL file for creating conversation items and altered the RESPONSES table to include a SAFETY_IDENTIFIER.
Changelog
  • scripts/oracle_flyway/schema-config.yaml
    • Updated the schema configuration to reflect the table renaming and column addition.
  • scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql
    • Added a new SQL file to create the RESPONSES and CONVERSATIONS tables as part of the baseline schema.
  • scripts/oracle_flyway/sql/V1__Create_responses_table.sql
    • Removed the old RESPONSES table creation script.
  • scripts/oracle_flyway/sql/V2__Create_conversation_items_and_alter_responses.sql
    • Renamed the SQL file and updated it to create conversation items and alter the RESPONSES table to include a SAFETY_IDENTIFIER.
Activity
  • Table CONVERSATIONS_V2 renamed to CONVERSATIONS.
  • Column CONVERSATION_ID added.
  • New SQL file created for RESPONSES and CONVERSATIONS tables.
  • Old RESPONSES table creation script deleted.
  • New SQL file introduced for conversation items.
  • RESPONSES table altered to include SAFETY_IDENTIFIER.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Oracle Flyway migrations to use the existing CONVERSATIONS table instead of creating a new CONVERSATIONS_V2 table. This aligns the test schema with the production baseline and updates the schema-config.yaml to correctly map the logical id column to the physical CONVERSATION_ID column. The changes correctly consolidate the RESPONSES and CONVERSATIONS table DDL into a single V1 migration script and remove the redundant CONVERSATIONS_V2 creation from the V2 script.

@key4ng
key4ng marked this pull request as ready for review March 5, 2026 00:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0256e367d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

extra_columns:
EXPIRES_AT:
sql_type: "TIMESTAMP WITH TIME ZONE"
default_value: "31-DEC-99 11.59.59.000000 PM +00:00"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use NLS-independent default for EXPIRES_AT

Setting default_value to the string 31-DEC-99 11.59.59.000000 PM +00:00 makes conversation inserts depend on Oracle session NLS settings (date language and timestamp format), because this value is passed through as a bound string in resolve_extra_column_values/value_to_sql_string instead of a typed timestamp expression. In environments where NLS_TIMESTAMP_TZ_FORMAT or NLS_DATE_LANGUAGE differs, create_conversation can fail with timestamp parsing errors when inserting into the TIMESTAMP WITH TIME ZONE NOT NULL EXPIRES_AT column.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/oracle_flyway/sql/V2__Create_conversation_items_and_alter_responses.sql (1)

28-35: 🧹 Nitpick | 🔵 Trivial

Foreign key constraints are missing; consider whether to add them.

CONVERSATION_ITEM_LINKS lacks foreign keys to CONVERSATIONS and CONVERSATION_ITEMS, and CONVERSATION_ITEMS.RESPONSE_ID has no FK to RESPONSES. This can allow orphaned records if referenced rows are deleted.

Note: The rg search shows no foreign key constraints exist anywhere in the migration directory, suggesting this is an intentional project-wide pattern, likely for performance on high-write tables. If maintaining this pattern, it's recommended to document the rationale and implement application-level referential integrity checks. If adding FK constraints is preferred, the suggested additions would be:

CONSTRAINT FK_CONV_ITEM_LINKS_CONV FOREIGN KEY (CONVERSATION_ID) REFERENCES CONVERSATIONS (CONVERSATION_ID),
CONSTRAINT FK_CONV_ITEM_LINKS_ITEM FOREIGN KEY (ITEM_ID) REFERENCES CONVERSATION_ITEMS (ID)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@scripts/oracle_flyway/sql/V2__Create_conversation_items_and_alter_responses.sql`
around lines 28 - 35, CONVERSATION_ITEM_LINKS and CONVERSATION_ITEMS are missing
foreign key constraints which allows orphans; add FK constraints: in the
CONVERSATION_ITEM_LINKS table add CONSTRAINT FK_CONV_ITEM_LINKS_CONV FOREIGN KEY
(CONVERSATION_ID) REFERENCES CONVERSATIONS(CONVERSATION_ID) and CONSTRAINT
FK_CONV_ITEM_LINKS_ITEM FOREIGN KEY (ITEM_ID) REFERENCES CONVERSATION_ITEMS(ID),
and in CONVERSATION_ITEMS add a FK for RESPONSE_ID like CONSTRAINT
FK_CONV_ITEM_RESPONSE FOREIGN KEY (RESPONSE_ID) REFERENCES RESPONSES(ID); choose
appropriate ON DELETE behavior (CASCADE/RESTRICT) for your domain, ensure
referenced columns are indexed/primary keys, or if you intentionally avoid
DB-level FKs, add a brief comment in the migration and implement
application-level referential checks instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/oracle_flyway/schema-config.yaml`:
- Around line 9-12: The EXPIRES_AT extra_columns entry currently sets a past
default ("31-DEC-99...") which conflicts with the migration
V2__Create_conversation_items_and_alter_responses.sql that uses DEFAULT
(SYSTIMESTAMP + INTERVAL '30' DAY); update the EXPIRES_AT default_value to match
the migration (a future timestamp semantics), remove the default_value to
require explicit values, or add a clear comment explaining why a past
placeholder is intentional—locate the extra_columns -> EXPIRES_AT block and
change the default_value (or remove it) to align with the migration's
SYSTIMESTAMP + INTERVAL '30' DAY behavior.

In `@scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql`:
- Around line 46-49: The composite index
IX_CONV_CONVERSATION_ID_CONVERSATION_STORE_ID on CONVERSATIONS is likely
redundant given the primary key on CONVERSATION_ID and the separate
IX_CONV_CONVERSATION_STORE_ID; update the migration to either remove
IX_CONV_CONVERSATION_ID_CONVERSATION_STORE_ID or replace it with a reordered
composite index (CONVERSATION_STORE_ID, CONVERSATION_ID) so that
CONVERSATION_STORE_ID-prefiltered queries are selective and covered—locate the
CREATE INDEX statements for IX_CONV_CONVERSATION_ID_CONVERSATION_STORE_ID and
IX_CONV_CONVERSATION_STORE_ID and adjust accordingly based on your common query
patterns.
- Around line 30-44: The CONVERSATIONS table defines EXPIRES_AT as NOT NULL
without a DEFAULT, forcing every INSERT to supply it; to match
CONVERSATION_ITEMS V2 behavior add a default expiration expression to the
EXPIRES_AT column in the CREATE TABLE CONVERSATIONS statement (e.g., change
"EXPIRES_AT TIMESTAMP WITH TIME ZONE NOT NULL" to "EXPIRES_AT TIMESTAMP WITH
TIME ZONE DEFAULT (SYSTIMESTAMP + INTERVAL '30' DAY) NOT NULL") so inserts get a
30-day TTL by default while preserving the NOT NULL constraint.

---

Outside diff comments:
In
`@scripts/oracle_flyway/sql/V2__Create_conversation_items_and_alter_responses.sql`:
- Around line 28-35: CONVERSATION_ITEM_LINKS and CONVERSATION_ITEMS are missing
foreign key constraints which allows orphans; add FK constraints: in the
CONVERSATION_ITEM_LINKS table add CONSTRAINT FK_CONV_ITEM_LINKS_CONV FOREIGN KEY
(CONVERSATION_ID) REFERENCES CONVERSATIONS(CONVERSATION_ID) and CONSTRAINT
FK_CONV_ITEM_LINKS_ITEM FOREIGN KEY (ITEM_ID) REFERENCES CONVERSATION_ITEMS(ID),
and in CONVERSATION_ITEMS add a FK for RESPONSE_ID like CONSTRAINT
FK_CONV_ITEM_RESPONSE FOREIGN KEY (RESPONSE_ID) REFERENCES RESPONSES(ID); choose
appropriate ON DELETE behavior (CASCADE/RESTRICT) for your domain, ensure
referenced columns are indexed/primary keys, or if you intentionally avoid
DB-level FKs, add a brief comment in the migration and implement
application-level referential checks instead.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fae0e2cc-9358-4224-8bcf-8c1d0a309525

📥 Commits

Reviewing files that changed from the base of the PR and between d7882b1 and e0256e3.

📒 Files selected for processing (4)
  • scripts/oracle_flyway/schema-config.yaml
  • scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql
  • scripts/oracle_flyway/sql/V1__Create_responses_table.sql
  • scripts/oracle_flyway/sql/V2__Create_conversation_items_and_alter_responses.sql
💤 Files with no reviewable changes (1)
  • scripts/oracle_flyway/sql/V1__Create_responses_table.sql

Comment on lines +9 to +12
extra_columns:
EXPIRES_AT:
sql_type: "TIMESTAMP WITH TIME ZONE"
default_value: "31-DEC-99 11.59.59.000000 PM +00:00"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check how other EXPIRES_AT defaults are defined in the codebase
rg -n -i 'expires_at|default_value' scripts/oracle_flyway/ --type yaml --type sql -C2

Repository: lightseekorg/smg

Length of output: 4272


🏁 Script executed:

#!/bin/bash
# Also search for any comments or documentation about this specific date or pattern
rg -n "31-DEC-99|31-DEC-2099|sentinel|no.expir" --type yaml --type sql -i

Repository: lightseekorg/smg

Length of output: 162


🏁 Script executed:

#!/bin/bash
# Look for any schema migration comments or documentation files
fd -e md -e txt -e sql | head -20 | xargs grep -l "EXPIRES_AT\|expir" 2>/dev/null | head -10

Repository: lightseekorg/smg

Length of output: 166


Fix the EXPIRES_AT default value—it uses a past date that contradicts the SQL migration logic.

The default value "31-DEC-99 11.59.59.000000 PM +00:00" sets an expiration date to December 31, 1999—27 years in the past. This means records would immediately appear expired upon insertion. The actual SQL migration in V2__Create_conversation_items_and_alter_responses.sql uses DEFAULT (SYSTIMESTAMP + INTERVAL '30' DAY), which sets a future expiration date instead.

Either update the schema-config default to match the SQL migration's intent, remove this default to require explicit values, or add a comment explaining why this past date is intentional. If it's a placeholder, this should not be committed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/oracle_flyway/schema-config.yaml` around lines 9 - 12, The EXPIRES_AT
extra_columns entry currently sets a past default ("31-DEC-99...") which
conflicts with the migration
V2__Create_conversation_items_and_alter_responses.sql that uses DEFAULT
(SYSTIMESTAMP + INTERVAL '30' DAY); update the EXPIRES_AT default_value to match
the migration (a future timestamp semantics), remove the default_value to
require explicit values, or add a clear comment explaining why a past
placeholder is intentional—locate the extra_columns -> EXPIRES_AT block and
change the default_value (or remove it) to align with the migration's
SYSTIMESTAMP + INTERVAL '30' DAY behavior.

key4ng added 4 commits March 4, 2026 17:32
- Renamed the CONVERSATIONS_V2 table to CONVERSATIONS and added a new column for CONVERSATION_ID.
- Created a new SQL file to establish the RESPONSES and CONVERSATIONS tables as part of the baseline schema.
- Deleted the old RESPONSES table creation script to streamline the migration process.
- Introduced a new SQL file for creating conversation items and altering the RESPONSES table to include a SAFETY_IDENTIFIER.

These changes enhance the database structure for better organization and future scalability.

Signed-off-by: Keyang Ru <rukeyang@gmail.com>
- Introduced a new column EXPIRES_AT with SQL type "TIMESTAMP WITH TIME ZONE" and a default value of "2099-12-31T23:59:59Z" to the CONVERSATIONS table.

This enhancement improves the schema by allowing for expiration tracking of conversations.

Signed-off-by: Keyang Ru <rukeyang@gmail.com>
- Changed the default value format of the EXPIRES_AT column in the CONVERSATIONS schema from "2099-12-31T23:59:59Z" to "31-DEC-99 11.59.59.000000 PM +00:00" for improved compatibility with legacy systems.

This update ensures consistency in date-time representation across the database.

Signed-off-by: Keyang Ru <rukeyang@gmail.com>
- Added 'scripts/ci_install_sglang.sh' and 'scripts/oracle_flyway/**' to the E2E job file patterns in the CI workflow configuration. This ensures that the new scripts are included in the relevant job checks.

Signed-off-by: Keyang Ru <rukeyang@gmail.com>
@key4ng
key4ng force-pushed the keyang/db-migration branch from e0256e3 to 510aad4 Compare March 5, 2026 01:36
@key4ng
key4ng requested a review from XinyueZhang369 as a code owner March 5, 2026 01:36
@github-actions github-actions Bot added the ci CI/CD configuration changes label Mar 5, 2026
Comment thread .github/workflows/pr-test-rust.yml Outdated
- Removed 'scripts/ci_install_sglang.sh' from the E2E job file patterns in the CI workflow configuration, streamlining the job checks to focus on relevant scripts.

Signed-off-by: Keyang Ru <rukeyang@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
scripts/oracle_flyway/schema-config.yaml (1)

10-12: ⚠️ Potential issue | 🟠 Major

Use an unambiguous EXPIRES_AT default format.

Line [12] uses a two-digit year (31-DEC-99), which is ambiguous and can produce unintended expiration behavior. Use an explicit 4-digit year (or remove defaulting here and force explicit values).

Suggested change
   extra_columns:
     EXPIRES_AT:
       sql_type: "TIMESTAMP WITH TIME ZONE"
-      default_value: "31-DEC-99 11.59.59.000000 PM +00:00"
+      default_value: "31-DEC-2099 11:59:59.000000 PM +00:00"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/oracle_flyway/schema-config.yaml` around lines 10 - 12, The
EXPIRES_AT column default_value uses an ambiguous two-digit year
("31-DEC-99..."); update the schema-config.yaml entry for EXPIRES_AT to use an
unambiguous 4-digit year (e.g., "31-DEC-2099 11:59:59.000000 PM +00:00") or
remove the default_value entirely so callers must supply explicit timestamps;
modify the EXPIRES_AT block (sql_type and default_value keys) accordingly to
ensure a clear, deterministic default.
scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql (1)

47-48: 🧹 Nitpick | 🔵 Trivial

Re-check composite index value vs existing PK/single-column index.

IX_CONV_CONVERSATION_ID_CONVERSATION_STORE_ID may be redundant with the PK on CONVERSATION_ID plus IX_CONV_CONVERSATION_STORE_ID. Keep it only if query plans show meaningful benefit for (CONVERSATION_ID, CONVERSATION_STORE_ID) predicates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql`
around lines 47 - 48, The composite index
IX_CONV_CONVERSATION_ID_CONVERSATION_STORE_ID on CONVERSATIONS may be redundant
given the primary key on CONVERSATION_ID and the single-column index
IX_CONV_CONVERSATION_STORE_ID; review query plans for common predicates that
filter by both CONVERSATION_ID and CONVERSATION_STORE_ID (use EXPLAIN/EXPLAIN
ANALYZE) and, if there is no meaningful benefit, remove the CREATE INDEX
IX_CONV_CONVERSATION_ID_CONVERSATION_STORE_ID statement from the migration and
keep only the single-column IX_CONV_CONVERSATION_STORE_ID (or document
justification if you choose to keep the composite index).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@scripts/oracle_flyway/schema-config.yaml`:
- Around line 10-12: The EXPIRES_AT column default_value uses an ambiguous
two-digit year ("31-DEC-99..."); update the schema-config.yaml entry for
EXPIRES_AT to use an unambiguous 4-digit year (e.g., "31-DEC-2099
11:59:59.000000 PM +00:00") or remove the default_value entirely so callers must
supply explicit timestamps; modify the EXPIRES_AT block (sql_type and
default_value keys) accordingly to ensure a clear, deterministic default.

In `@scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql`:
- Around line 47-48: The composite index
IX_CONV_CONVERSATION_ID_CONVERSATION_STORE_ID on CONVERSATIONS may be redundant
given the primary key on CONVERSATION_ID and the single-column index
IX_CONV_CONVERSATION_STORE_ID; review query plans for common predicates that
filter by both CONVERSATION_ID and CONVERSATION_STORE_ID (use EXPLAIN/EXPLAIN
ANALYZE) and, if there is no meaningful benefit, remove the CREATE INDEX
IX_CONV_CONVERSATION_ID_CONVERSATION_STORE_ID statement from the migration and
keep only the single-column IX_CONV_CONVERSATION_STORE_ID (or document
justification if you choose to keep the composite index).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: caf7ff2f-cdb4-4abe-8867-a48e5e2034a0

📥 Commits

Reviewing files that changed from the base of the PR and between e0256e3 and 510aad4.

📒 Files selected for processing (5)
  • .github/workflows/pr-test-rust.yml
  • scripts/oracle_flyway/schema-config.yaml
  • scripts/oracle_flyway/sql/V1__Create_responses_and_conversations_table.sql
  • scripts/oracle_flyway/sql/V1__Create_responses_table.sql
  • scripts/oracle_flyway/sql/V2__Create_conversation_items_and_alter_responses.sql
💤 Files with no reviewable changes (1)
  • scripts/oracle_flyway/sql/V1__Create_responses_table.sql

@key4ng
key4ng merged commit 030280c into main Mar 5, 2026
23 of 25 checks passed
@key4ng
key4ng deleted the keyang/db-migration branch March 5, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD configuration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants