It looks like you're new here. If you want to get involved, click one of these buttons!
class Baked_goods_model extends Base_module_model {
public $foreign_keys = array('category_id' => array('app' => 'product_categories_model'), 'where' => array('relevant' => 'Baked'));
...
class Product_categories_model extends Base_module_model {
public $record_class = 'Product_category';
public $required = array('name','relevant','order');
....
CREATE TABLE `w_product_categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`relevant` enum('Baked','Brew') NOT NULL DEFAULT 'Baked' COMMENT 'Which area is this category relvant to?',
`order` int(2) NOT NULL COMMENT 'Sort Order within relevant category',
PRIMARY KEY (`id`),
UNIQUE KEY `sort_order` (`relevant`,`order`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `w_baked_goods` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`description` varchar(5000) NOT NULL,
`image` varchar(255) NULL DEFAULT NULL,
`cat_id` int(11) NOT NULL,
`featured` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
Comments
(no way to delete a post?)