Skip to content

fix(sql): move EXAMPLE_1 database creation to end of schema file - #3183

Open
mumubuku wants to merge 1 commit into
eosphoros-ai:mainfrom
mumubuku:fix/sql-example-database-context
Open

fix(sql): move EXAMPLE_1 database creation to end of schema file#3183
mumubuku wants to merge 1 commit into
eosphoros-ai:mainfrom
mumubuku:fix/sql-example-database-context

Conversation

@mumubuku

@mumubuku mumubuku commented Aug 7, 2026

Copy link
Copy Markdown

Fix #3115

Problem

In \�ssets/schema/dbgpt.sql, the \CREATE DATABASE EXAMPLE_1; use EXAMPLE_1;\ statements were placed in the middle of the file (line 584), causing subsequent tables (\connector_instance, \dbgpt_serve_scheduled_task, \dbgpt_serve_scheduled_run) to be created in the \EXAMPLE_1\ database instead of the \dbgpt\ database, leading to startup failures.

Solution

Move the \EXAMPLE_1\ database creation and \users\ table SQL to the end of the file, ensuring all \dbgpt\ database tables are created in the correct database context.

Verification

  • All \dbgpt\ tables (including \connector_instance, \dbgpt_serve_scheduled_task, \dbgpt_serve_scheduled_run) are now created after \use dbgpt;\ and before \use EXAMPLE_1;`n- The \users\ table is created in \EXAMPLE_1\ database at the end of the file

…phoros-ai#3115)

The EXAMPLE_1 database creation and users table were placed in the middle of dbgpt.sql, causing subsequent tables (connector_instance, dbgpt_serve_scheduled_task, dbgpt_serve_scheduled_run) to be created in the EXAMPLE_1 database instead of the dbgpt database. Move the EXAMPLE_1 section to the end of the file so all dbgpt tables are created in the correct database context.
@github-actions github-actions Bot added the fix Bug fixes label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d449a5f1-80fe-4f2e-9b96-8a718dcb5d42

📥 Commits

Reviewing files that changed from the base of the PR and between 4211e02 and 64e4267.

📒 Files selected for processing (1)
  • assets/schema/dbgpt.sql
📜 Recent review details
🔇 Additional comments (1)
assets/schema/dbgpt.sql (1)

640-696: LGTM!


📝 Walkthrough
  1. Moves CREATE DATABASE EXAMPLE_1 and the users table setup to the end of assets/schema/dbgpt.sql. This keeps the scheduled-task tables in dbgpt and creates users in EXAMPLE_1.

  2. Affects the SQL initialization script mounted by docker-compose.yml. It changes no public APIs, table definitions, or sample data.

  3. The change fixes the database-selection order during Docker Compose startup. No new security or performance risks are expected. SQL initialization remains dependent on MySQL-compatible execution order.

  4. No dedicated tests cover this schema change. Run:

    • git diff --check
    • docker compose config
    • docker compose up

Walkthrough

The schema moves the EXAMPLE_1 database, users table, and sample records to the end of assets/schema/dbgpt.sql, after the scheduled-task definitions. The SQL definitions and records remain unchanged.

Changes

Schema initialization

Layer / File(s) Summary
Move sample database setup to schema end
assets/schema/dbgpt.sql
Moves the EXAMPLE_1 database, users table, and 20 sample user inserts after the scheduled-run definition without changing their SQL content.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses valid Conventional Commit syntax and accurately describes moving EXAMPLE_1 database creation to the end of the schema.
Description check ✅ Passed The description explains issue #3115, the cause, the solution, and verification, but omits template sections such as snapshots and the checklist.
Linked Issues check ✅ Passed The SQL reorder addresses issue #3115 by keeping the affected tables in dbgpt and creating users in EXAMPLE_1.
Out of Scope Changes check ✅ Passed The changes only reorder the EXAMPLE_1 setup and preserve the existing SQL definitions and sample data.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Module Name] Bug title

1 participant