orders_products_id int not_null auto_increment comment(Primary key - unique identifier for each order line item)
orders_id int not_null comment(FK to orders table - order this product belongs to)
products_id int not_null comment(FK to products table - product that was ordered)
products_model varchar(255) comment(Product model or SKU at time of order)
products_name varchar(255) not_null comment(Product name at time of order - preserved for historical accuracy)
products_price decimal(15,4) not_null comment(Base product price at time of order before tax)
final_price decimal(15,4) not_null comment(Final product price at time of order after discounts before tax)
products_tax decimal(7,4) not_null comment(Tax rate applied to this product - percentage as decimal)
products_quantity int(2) not_null comment(Quantity of this product ordered)
--
primary orders_products_id
idx_orders_products_orders_id orders_id
idx_orders_products_products_id products_id
##
engine innodb
character_set utf8mb4
collate utf8mb4_unicode_ci