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

[57812] Changed CustomOptions to become a hierarchy #16749

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

apfohl
Copy link
Member

@apfohl apfohl commented Sep 18, 2024

Ticket

https://community.openproject.org/projects/openproject/work_packages/57812/activity

What are you trying to accomplish?

Screenshots

What approach did you choose and why?

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@apfohl apfohl force-pushed the implementation/57812-add-model-and-data-migration branch from 4c77d3f to c67f653 Compare September 18, 2024 11:54
@@ -0,0 +1,16 @@
class CreateCustomOptionHierarchies < ActiveRecord::Migration[7.1]
def change
create_table :custom_option_hierarchies, id: false do |t|
Copy link
Member

@akabiru akabiru Sep 18, 2024

Choose a reason for hiding this comment

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

🟠 I would leave the id present- ActiveRecord won't play well with nil primary key. For example, #destroy won't work which means you can't leverage things like AR callbacks or the in-house DeleteService which relies on #destroy out of the box.

Of course you have the option to define composite primary keys but I've recently learnt the hard way the change in data structure can be messy

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

Successfully merging this pull request may close these issues.

2 participants