Skip to content

Conversation

@martastain
Copy link
Member

@martastain martastain commented Apr 15, 2025

This pull request introduces support for a new product_base_type field 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

  • Added product_base_type as a nullable column to the products table in all project schemas, removed the foreign key constraint on product_type, and created an index for product_base_type. Also added created_by and updated_by columns to folders, tasks, products, versions, and representations tables for audit purposes.
  • Added support for the new product_base_type field in the product entity model (fields.py and product.py) and ensured it is properly handled in API responses and setters/getters.
  • Introduced the ProductBaseType GraphQL type and exposed a new product_base_types field on the ProjectNode to query available base types. Updated GraphQL nodes and resolvers to handle filtering and returning product_base_type.
  • Modified product queries to support filtering by product_base_type in addition to product_type, and refactored SQL column selection for products to be more flexible.

@martastain martastain added the type: feature Adding something new and exciting to the product label Apr 15, 2025
@martastain martastain requested a review from Copilot October 22, 2025 08:34
Copy link
Contributor

Copilot AI left a 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_type as a nullable column to products table and corresponding index
  • Removed foreign key constraint on product_type column to use weak references
  • Added created_by and updated_by audit 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.

martastain and others added 3 commits October 22, 2025 10:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a 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.

@martastain martastain marked this pull request as ready for review October 29, 2025 09:36
@martastain martastain requested a review from Copilot October 29, 2025 09:36
Copy link
Contributor

Copilot AI left a 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.

@martastain martastain requested a review from antirotor October 30, 2025 11:03
@martastain martastain merged commit e6cd126 into develop Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Adding something new and exciting to the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🏛️Product base types: add support

3 participants