⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Not so sure my database layout allows for what i want to do



MichaelM
  • profile picture
  • Member

Posted 16 July 2013 - 12:57 PM

Hey,
 
I've used Grocery CRUD quite a few times but mostly on extremely limited databases so requirement for millions of tables wasn't really required, however today I was looking at putting it on a more complex system, and I don't believe I have enough experience with Grocery CRUD to know if its possible to implement really or if i should just throw in the towel and build my own CRUD system.
 
I have this current MySQL layout for my items:
 
CREATE TABLE `item` (
  `item_id` int(12) NOT NULL AUTO_INCREMENT,
  `stockcode` varchar(32) NOT NULL,
  `description` varchar(55) NOT NULL,
  `title` varchar(128) NOT NULL,
  `cost` decimal(6,2) NOT NULL,
  PRIMARY KEY (`item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
 
CREATE TABLE `item_feature` (
  `item_id` int(12) NOT NULL,
  `feature` varchar(32) NOT NULL,
  `feature_value` varchar(64) NOT NULL,
  PRIMARY KEY (`item_id`,`feature`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
 
As you can maybe tell a single item can have multiple features, this is main hurdle in this project to be honest, would just like to know how I should get this running with grocery crud (if i even can).

davidoster
  • profile picture
  • Member

Posted 16 July 2013 - 22:52 PM

Hello and welcome to the forums [member=michaelm].

Well this is a typical Master/Detail structure and unfortunately this is not supported natively from Grocery CRUD.

You can have the two tables on different controller function and make a set_relation between them but this is what this library offers at the moment without any custom code.

If you need anything more than that then you need to program it yourself.

As far as it concerns the million of records, if I understood correctly, for this you will need the default theme, flexigrid that uses ajax to load the list of records.