`email` varchar(128) default NULL,
`id` int(11) NOT NULL auto_increment,
`isOwner` int(11) default NULL,
- PRIMARY KEY (`id`),
+ PRIMARY KEY (`id`)
) ;
ALTER TABLE `Company_Name` ADD INDEX name_lookup (`name`);
ALTER TABLE Projects ADD COLUMN agency_id int(11) NOT NULL DEFAULT 0 ;
-
+#-- we duplicate office_id and company_id here...
+#-- not sure if we should keep doing that in the new design...
+#-- we should improve our links code to handle this..
+CREATE TABLE `ProjectDirectory` (
+ `id` int(11) NOT NULL auto_increment,
+ `project_id` int(11) NOT NULL,
+ `person_id` int(11) NOT NULL,
+ `ispm` int(11) NOT NULL,
+ `role` varchar(16) NOT NULL,
+ PRIMARY KEY (`id`)
+) ;
+
CREATE TABLE `Images` (
`id` int(11) NOT NULL auto_increment,
`on_id` int(11) NOT NULL,
`person_id` int(11) NOT NULL,
`created` datetime NOT NULL,
- PRIMARY KEY (`int`),
+ PRIMARY KEY (`int`)
);
alter table core_locking ADD INDEX `lookup`(`on_table`, `on_id`, `person_id`, `created`);
ALTER TABLE translations ADD INDEX qlookup (module, tfile, tlang, tkey);
+# - used to trigger emails about changes to items being watched.
CREATE TABLE `core_watch` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
`ontable` varchar(128) NOT NULL,
- `onid` varchar(128) NOT NULL,
- `user_id` varchar(128) NOT NULL,
+ `onid` int(11) NOT NULL,
+ `person_id` int(11) NOT NULL,
`event` varchar(128) NOT NULL,
`medium` varchar(128) NOT NULL,
`active` int(11) NOT NULL DEFAULT '1',
- PRIMARY KEY (`ontype`,`onid`,`user_id`,`event`,`medium`)
-) ;
\ No newline at end of file
+ PRIMARY KEY (id)
+) ;
+ALTER TABLE core_watch ADD INDEX qlookup (`ontable`,`onid`,`user_id`,`event`,`medium`);
+
+
+
+
+# - used by email / tracker to handle alises - we have to be carefull adding to this table...
+
+CREATE TABLE `core_person_alias` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `person_id` varchar(128) DEFAULT NULL,
+ `alias` varchar(254) NOT NULL,
+ PRIMARY KEY (`id`)
+) ;
+ALTER TABLE core_watch ADD INDEX qlookup (`alias`);