This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
Incam_SGD/sql/mysql/upgrade/3.0.1.1/document_role_allocations.sql

25 lines
763 B
SQL

SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `document_role_allocations`;
CREATE TABLE `document_role_allocations` (
`id` int(11) NOT NULL default '0',
`document_id` int(11) NOT NULL default '0',
`role_id` int(11) NOT NULL default '0',
`permission_descriptor_id` int(11) NOT NULL default '0',
UNIQUE KEY `id` (`id`),
KEY `document_id` (`document_id`)
) TYPE=InnoDB ;
DROP TABLE IF EXISTS `zseq_document_role_allocations`;
CREATE TABLE `zseq_document_role_allocations` (
`id` int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
INSERT INTO `roles` VALUES (-1, 'Owner');
ALTER TABLE `documents` ADD `owner_id` int(11) NOT NULL default '0';
UPDATE `documents` SET `owner_id` = `creator_id`;
SET FOREIGN_KEY_CHECKS=1;