mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 21:38:05 +02:00
Add redundant contact_id field for search kit/form builder; add index on category field...
This commit is contained in:
parent
9fee48603b
commit
7b611c343f
7 changed files with 113 additions and 29 deletions
|
@ -35,9 +35,11 @@ SET FOREIGN_KEY_CHECKS=1;
|
|||
-- *******************************************************/
|
||||
CREATE TABLE `civicrm_contact_category` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique ID, corresponds to contact id',
|
||||
`contact_id` int unsigned NOT NULL COMMENT 'Same as id but for FormBuilder',
|
||||
`category` int unsigned NOT NULL DEFAULT 0,
|
||||
`next_category` int unsigned NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT FK_civicrm_contact_category_id FOREIGN KEY (`id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE
|
||||
INDEX `index_category`(category),
|
||||
CONSTRAINT FK_civicrm_contact_category_contact_id FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE
|
||||
)
|
||||
ENGINE=InnoDB;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue