-
Notifications
You must be signed in to change notification settings - Fork 28
Support for product base types #575
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
Conversation
…into support-for-product-base-types
…into support-for-product-base-types
and align it with #622
… for projects without product base types)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for a new optional product_base_type field for products, removes the foreign key constraint on product_type to allow more flexible product categorization, and adds audit tracking columns (created_by, updated_by) to multiple entity tables.
Key Changes:
- Added
product_base_typeas a nullable column to products table and corresponding index - Removed foreign key constraint on
product_typecolumn to use weak references - Added
created_byandupdated_byaudit columns to folders, tasks, products, versions, and representations tables
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/schema.project.sql | Added product_base_type column, removed FK constraint on product_type, added audit columns to entity tables |
| schemas/migrations/00000010.sql | Migration script to remove product type FK constraint and add new columns to existing projects |
| ayon_server/graphql/resolvers/products.py | Added support for filtering products by product_base_type and simplified column selection |
| ayon_server/graphql/nodes/project.py | Added product_base_types field to expose available base types via GraphQL |
| ayon_server/graphql/nodes/product.py | Added product_base_type field to ProductNode |
| ayon_server/graphql/nodes/common.py | Defined new ProductBaseType GraphQL type |
| ayon_server/entities/product.py | Added getter/setter for product_base_type property |
| ayon_server/entities/models/fields.py | Added field definition for product_base_type and fixed typo in product_type description |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces support for a new
product_base_typefield throughout the backend, updates the database schema to include new audit columns, and refactors how product types are referenced. The changes improve flexibility in product categorization and add tracking of entity creation and updates.Schema and Database Changes
product_base_typeas a nullable column to theproductstable in all project schemas, removed the foreign key constraint onproduct_type, and created an index forproduct_base_type. Also addedcreated_byandupdated_bycolumns tofolders,tasks,products,versions, andrepresentationstables for audit purposes.product_base_typefield in the product entity model (fields.pyandproduct.py) and ensured it is properly handled in API responses and setters/getters.ProductBaseTypeGraphQL type and exposed a newproduct_base_typesfield on theProjectNodeto query available base types. Updated GraphQL nodes and resolvers to handle filtering and returningproduct_base_type.product_base_typein addition toproduct_type, and refactored SQL column selection for products to be more flexible.