且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

mysql将负整数值设置为int的主自动增量字段

更新时间:2023-02-12 08:33:34

选项一(我的偏爱)-在产品表中允许categoryid == NULL.清楚地显示了未分类的产品.

option one (my preference) - allow in products table categoryid == NULL. This is clearly shown non-categorized products.

选项二-创建默认类别,如果未指定产品类别,则将产品分配到该类别

option two - create default category and assign product to this category if product category not specified