Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpaca schema update #18

Merged
merged 5 commits into from
Nov 11, 2024
Merged

Alpaca schema update #18

merged 5 commits into from
Nov 11, 2024

Conversation

sebastian-j-ibanez
Copy link
Collaborator

@sebastian-j-ibanez sebastian-j-ibanez commented Nov 11, 2024

Bring schema changes from open-o-previous/revise-schema-alpaca-new to Open-O/develop-alpaca.

Changes include:

  • add oscarinit_2024.sql.
  • set default database engine to InnoDB.
  • set default char encoding to utf8mb4.
  • cherry pick hibernate query fixes for CaseManagementNoteDAOImpl.java.
  • remove uid column from pharmacyInfo table.
  • fix lst_orgcd insert query in development.sql.

Summary by Sourcery

Update the database schema by adding a new initialization script and modifying existing table structures. Fix Hibernate query parameter indexing in 'CaseManagementNoteDAOImpl.java'. Set default database configurations to InnoDB and utf8mb4.

New Features:

  • Introduce a new SQL script 'oscarinit_2024.sql' to initialize database tables with updated structures.

Bug Fixes:

  • Fix Hibernate query parameter indexing in 'CaseManagementNoteDAOImpl.java' to use named parameters.

Enhancements:

  • Set the default database engine to InnoDB and character encoding to utf8mb4 for improved compatibility and performance.

Copy link

sourcery-ai bot commented Nov 11, 2024

Reviewer's Guide by Sourcery

This pull request updates the database schema and hibernate queries in the Alpaca project. The main changes include updating the database character encoding to utf8mb4, setting InnoDB as the default engine, adding new SQL initialization files, and fixing hibernate query parameter placeholders. The changes aim to improve database compatibility and query performance.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Update hibernate query parameter placeholders from '?' to indexed parameters '?0', '?1', etc.
  • Replace '?' placeholders with indexed parameters in CaseManagementNoteDAOImpl queries
  • Update parameter binding in SQL queries to use indexed parameters
  • Maintain consistent query functionality while improving parameter binding
src/main/java/org/oscarehr/casemgmt/dao/CaseManagementNoteDAOImpl.java
Add new database initialization file and update schema
  • Add oscarinit_2024.sql to initialization scripts
  • Remove uid column from pharmacyInfo table
  • Add new tables with utf8mb4 character encoding
  • Add foreign key constraints to existing tables
  • Modify column properties and sequences in various tables
database/mysql/oscarinit.sql
database/mysql/createdatabase_generic.sh
database/mysql/oscarinit_2024.sql
Update database configuration and table properties
  • Set default database engine to InnoDB
  • Set default character encoding to utf8mb4
  • Update table collations to utf8_general_ci
  • Add and modify table constraints and foreign keys
.devcontainer/development/config/shared/my.cnf

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sebastian-j-ibanez - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@yingbull yingbull merged commit 26174f0 into develop/alpaca Nov 11, 2024
3 of 4 checks passed
@sebastian-j-ibanez sebastian-j-ibanez deleted the alpaca-schema-update branch December 5, 2024 19:29
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.

3 participants