Skip to content

Fix/demo data sql#227

Merged
lindaeskilsson merged 5 commits into
mainfrom
fix/demo-data-sql
Apr 23, 2026
Merged

Fix/demo data sql#227
lindaeskilsson merged 5 commits into
mainfrom
fix/demo-data-sql

Conversation

@lindaeskilsson

@lindaeskilsson lindaeskilsson commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Ändringar:

  • Tar bort id = EXCLUDED.id från alla ON CONFLICT-satser för att undvika FK-integritetsproblem
  • Lägger till mer realistisk demodata: en extra ägare (Lars), fler djur, ärenden i olika statusar och kommentarer
  • Uppdaterar lösenordshash så att alla användare loggar in med password
  • Flyttar spring.sql.init.mode, schema-locations och platform från application.properties till application-dev.properties

Testanvändare:

Closes #122
closes #250

Summary by CodeRabbit

  • Chores
    • Updated database initialization configuration for development environments with explicit schema and data loading settings
    • Refreshed demo data with new sample users, pets, medical records, and comments for testing and development purposes

… seed data and move sql.init settings to dev profile
@coderabbitai

coderabbitai Bot commented Apr 21, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@lindaeskilsson has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 28 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 43 minutes and 28 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 237f48c2-f528-4833-be8c-d875fc6994aa

📥 Commits

Reviewing files that changed from the base of the PR and between 40e6258 and 3744fdb.

📒 Files selected for processing (1)
  • src/main/resources/data.sql
📝 Walkthrough

Walkthrough

Moved Spring SQL initialization settings out of the main profile into the dev profile and expanded dev-specific SQL init properties; replaced/updated seeded demo data in data.sql (upserts, users, pets, medical records, comments) and adjusted trailing newlines.

Changes

Cohort / File(s) Summary
SQL Configs
src/main/resources/application.properties, src/main/resources/application-dev.properties
Removed SQL init properties from main profile; added/rehabilitated dev-only SQL init settings (spring.sql.init.mode=always, schema-locations, platform=postgresql, data-locations) in application-dev.properties.
Demo Seed Data
src/main/resources/data.sql
Large update to demo seed: cleaned up ON CONFLICT upserts (removed id = EXCLUDED.id where appropriate), updated password hashes, added new user (Lars) and pets (including weight_kg), extended medical records, and added a batch of comments. Trailing newline adjustments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • johanbriger

Poem

🐰
I hopped through configs, tidy and spry,
Moved seeds to dev so tests can fly.
Lars found a home and pets found treats,
Upserts fixed neatly, no more defeats.
Demo blooms bright — a rabbit’s small feat.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix/demo data sql' is vague and uses non-descriptive terms that don't clearly convey the main changes being made. Use a more specific title like 'Fix upsert conflicts and add demo data' to clearly indicate the primary changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The pull request addresses all major coding objectives from issue #122: fixes ON CONFLICT clauses, adds realistic demo data with new users and pets, updates password hashes, and moves SQL initialization settings to dev profile.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #122 objectives: data.sql improvements, SQL configuration management, and demo data enhancements. No out-of-scope changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/demo-data-sql

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 and usage tips.

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/resources/data.sql`:
- Around line 18-64: The ON CONFLICT clauses only update name, leaving
password_hash, role, clinic_id, is_active, and updated_at stale; change each
INSERT INTO users ... ON CONFLICT (email) DO UPDATE SET ... to refresh non-key
demo fields (e.g., name, password_hash, role, clinic_id where present,
is_active, updated_at) while explicitly not updating id; for the vet row ensure
clinic_id is included in the update so the seeded clinic association is
preserved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 196a296f-9905-48d0-a8f3-6a043c3c7754

📥 Commits

Reviewing files that changed from the base of the PR and between 60f6cea and b787dc8.

📒 Files selected for processing (3)
  • src/main/resources/application-dev.properties
  • src/main/resources/application.properties
  • src/main/resources/data.sql
💤 Files with no reviewable changes (1)
  • src/main/resources/application.properties

Comment thread src/main/resources/data.sql Outdated
@lindaeskilsson
lindaeskilsson merged commit 1df9bf6 into main Apr 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lägg till vikt på djur - uppdatera mockdata i data.sql Review and clean up test data in data.sql for demo/presentation

1 participant