Difference between revisions of "VbzCart/tables/shop cart line"
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
|  (changing table names to singular) |  (formatting tweaks; removing all "item presentation" fields) | ||
| Line 4: | Line 4: | ||
| * '''History''': | * '''History''': | ||
| ** '''2009-06-16''' Changing table name to singular | ** '''2009-06-16''' Changing table name to singular | ||
| + | ** '''2009-07-12''' Tentatively removed all "item presentation" fields -- they belong in {{vbzcart|table|ord_lines}} | ||
| ==SQL== | ==SQL== | ||
| <section begin=sql /><mysql>DROP TABLE IF EXISTS `shop_cart_line`; | <section begin=sql /><mysql>DROP TABLE IF EXISTS `shop_cart_line`; | ||
| CREATE TABLE `shop_cart_line` ( | CREATE TABLE `shop_cart_line` ( | ||
| − |    `ID`  | + |    `ID`          INT          NOT NULL AUTO_INCREMENT, | 
| − |    `ID_Cart`  | + |    `ID_Cart`     INT          NOT NULL COMMENT "shop_cart.ID", | 
| − |    `ID_Item`  | + |    `ID_Item`     INT          NOT NULL COMMENT "cat_items.ID", | 
| − |    `Qty`  | + |    `Qty`         INT          NOT NULL COMMENT "quantity ordered; 0 = removed from order", | 
| − |    `WhenAdded`  | + |    `WhenAdded`   DATETIME     NOT NULL COMMENT "when this item was first added to the order", | 
| − |    `WhenEdited` DATETIME NOT NULL COMMENT "when the quantity for this item was last changed | + |    `WhenEdited`  DATETIME     NOT NULL COMMENT "when the quantity for this item was last changed", | 
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|    PRIMARY KEY(`ID`) |    PRIMARY KEY(`ID`) | ||
|   ) ENGINE = MYISAM;</mysql> |   ) ENGINE = MYISAM;</mysql> | ||
| <section end=sql /> | <section end=sql /> | ||
| + | ==Removed== | ||
| + | I'm inclined to think that these don't belong here, but rather in {{vbzcart|table|ord_lines}}: | ||
| + | <mysql> | ||
| + | /* The remaining fields preserve a record of how the item was presented to the customer, and should be used | ||
| + |  at shipping time -- overriding any possible changes to the item's catalog record. */ | ||
| + | |||
| + |   `PriceItem`   DECIMAL(9,2) NOT NULL COMMENT "price of item quoted at order time", | ||
| + |   `PriceShItm`  DECIMAL(9,2) NOT NULL COMMENT "per-item shipping quoted for this item at order time", | ||
| + |   `PriceShPkg`  DECIMAL(9,2) NOT NULL COMMENT "per-package shipping quoted for this item at order time", | ||
| + |   `CatNum`      VARCHAR(63)           COMMENT "cat_items.CatNum of item as sold", | ||
| + |   `ID_Title`    INT          NOT NULL COMMENT "cat_titles.ID", | ||
| + |   `DescText`    VARCHAR(255) NOT NULL COMMENT "plain-text description of item being ordered (e.g. for emails)", | ||
| + |   `DescHtml`    VARCHAR(255) NOT NULL COMMENT "HTML description of item being ordered, for web-page display", | ||
| + | </mysql> | ||
Revision as of 14:12, 12 July 2009
About
- Purpose: individual items in a shopping cart
- Parent: shop_cart
- History:
- 2009-06-16 Changing table name to singular
- 2009-07-12 Tentatively removed all "item presentation" fields -- they belong in ord_lines
 
SQL
<mysql>DROP TABLE IF EXISTS `shop_cart_line`; CREATE TABLE `shop_cart_line` (
`ID` INT NOT NULL AUTO_INCREMENT, `ID_Cart` INT NOT NULL COMMENT "shop_cart.ID", `ID_Item` INT NOT NULL COMMENT "cat_items.ID", `Qty` INT NOT NULL COMMENT "quantity ordered; 0 = removed from order", `WhenAdded` DATETIME NOT NULL COMMENT "when this item was first added to the order", `WhenEdited` DATETIME NOT NULL COMMENT "when the quantity for this item was last changed", PRIMARY KEY(`ID`) ) ENGINE = MYISAM;</mysql>
Removed
I'm inclined to think that these don't belong here, but rather in ord_lines: <mysql> /* The remaining fields preserve a record of how the item was presented to the customer, and should be used
at shipping time -- overriding any possible changes to the item's catalog record. */
`PriceItem` DECIMAL(9,2) NOT NULL COMMENT "price of item quoted at order time", `PriceShItm` DECIMAL(9,2) NOT NULL COMMENT "per-item shipping quoted for this item at order time", `PriceShPkg` DECIMAL(9,2) NOT NULL COMMENT "per-package shipping quoted for this item at order time", `CatNum` VARCHAR(63) COMMENT "cat_items.CatNum of item as sold", `ID_Title` INT NOT NULL COMMENT "cat_titles.ID", `DescText` VARCHAR(255) NOT NULL COMMENT "plain-text description of item being ordered (e.g. for emails)", `DescHtml` VARCHAR(255) NOT NULL COMMENT "HTML description of item being ordered, for web-page display",
</mysql>