NO-ISSUE: Add create_object_schema stored procedure#657
Conversation
|
@jhernand: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhernand The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (3)
WalkthroughAdds a PostgreSQL stored procedure ChangesObject Schema Creation Procedure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Add a database migration that creates a reusable `create_object_schema`
stored procedure. It encapsulates the boilerplate DDL that every new
object type requires: the object table with all standard DAO columns,
the corresponding archive table, the four standard indexes on `name`,
`creator`, `tenant`, and `labels`, and the tenant foreign key
constraint referencing the `organizations` table.
Future migrations that introduce a new object type can call the
procedure instead of repeating the DDL manually:
```sql
call create_object_schema('widgets');
```
The AGENTS.md file is updated with guidance directing contributors to
use this procedure when introducing new object types.
Assisted-by: Cursor
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
525a488 to
8abd380
Compare
Summary
create_object_schemastored procedure.The procedure encapsulates all the boilerplate DDL required when introducing a new object type:
the object table, the archive table, the standard indexes, and the tenant foreign key. Future
migrations can replace dozens of lines of repeated DDL with a single
call create_object_schema('widgets').AGENTS.mdwith guidance directing contributors to use this procedure for new objecttypes.
Test plan
ginkgo run internal/database/migrationspasses (42/42 specs).ginkgo run internal/databasepasses (63/63 specs).go build ./cmd/fulfillment-service,go build ./cmd/osac).Summary by CodeRabbit
New Features
Documentation
Tests