Tuesday, January 20, 2015

Re: Problem with belongstomany and the new bake plugin

Try it please out:

DROP TABLE IF EXISTS `batches_documents` ;
CREATE TABLE IF NOT EXISTS
`batches_documents` (
    batch_id INT
(11) NOT NULL,
    document_id INT
(11) NOT NULL,
    PRIMARY KEY
(`batch_id`,`document_id`)
);


DROP TABLE IF EXISTS
`batches` ;
CREATE TABLE IF NOT EXISTS
`batches` (
    id INT
(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    batch_number VARCHAR
(50) NOT NULL UNIQUE,
    supplier_id INT
(11) NOT NULL,
    created DATETIME DEFAULT NULL
,
    modified DATETIME DEFAULT NULL
);


DROP TABLE IF EXISTS
`documents` ;
CREATE TABLE IF NOT EXISTS
`documents` (
    id INT
(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR
(50) NOT NULL,
    file VARCHAR
(50) NOT NULL,
    created DATETIME DEFAULT NULL
,
    modified DATETIME DEFAULT NULL
);

/bin/cake bake all Batches
/bin/cake bake all Documents


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: