Remove organizations#3923
Conversation
Summary by CodeRabbit
WalkthroughThis PR removes organization-related support across the audit system and domain models, including API response constants, AuditLog fields, service initialization, MyBatis persistence mappings, database schema tables, and data access layer queries, migrating the database schema from version 4.5.0.5 to 4.5.1.1. ChangesOrganization Support Removal
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/resources/crafter/studio/database/upgrade/4.5.x/4.5.1.0-to-4.5.1.1.sql`:
- Around line 19-22: The ALTER TABLE `group` statement uses unsupported `DROP
FOREIGN KEY IF EXISTS` syntax in MySQL; change the migration to first detect the
FK/index/column existence and only drop them if present: query
INFORMATION_SCHEMA.KEY_COLUMN_USAGE or INFORMATION_SCHEMA.STATISTICS to check
for foreign key `group_ix_org_id` and index `group_ix_org_id` and wrap the DROP
FOREIGN KEY `group_ix_org_id`, DROP INDEX `group_ix_org_id`, and DROP COLUMN
`org_id` operations inside conditional logic (or a small stored procedure/IF
block) so the migration does not use the invalid `IF EXISTS` clause and will
safely run on MySQL.
🪄 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: 3c3cf4f6-4d09-47c3-8f96-a18bd0c79d2a
📒 Files selected for processing (10)
src/main/api/studio-api.yamlsrc/main/java/org/craftercms/studio/api/v2/dal/AuditLog.javasrc/main/java/org/craftercms/studio/api/v2/dal/Organization.javasrc/main/java/org/craftercms/studio/impl/v2/service/audit/internal/AuditServiceInternalImpl.javasrc/main/java/org/craftercms/studio/model/rest/ApiResponse.javasrc/main/resources/crafter/studio/database/createDDL.sqlsrc/main/resources/crafter/studio/database/upgrade/4.5.x/4.5.1.0-to-4.5.1.1.sqlsrc/main/resources/crafter/studio/upgrade/pipelines.yamlsrc/main/resources/org/craftercms/studio/api/v2/dal/AuditDAO.xmlsrc/main/resources/org/craftercms/studio/api/v2/dal/SecurityDAO.xml
💤 Files with no reviewable changes (2)
- src/main/java/org/craftercms/studio/api/v2/dal/Organization.java
- src/main/api/studio-api.yaml
Remove organizations
craftercms/craftercms#8652