diff --git a/installer/sql/create-mssql.sql b/installer/sql/create-mssql.sql index c2766af2115..1457e92cbf6 100644 --- a/installer/sql/create-mssql.sql +++ b/installer/sql/create-mssql.sql @@ -207,16 +207,17 @@ CREATE TABLE [prefix_participants] ( -- Table structure for table permissions -- CREATE TABLE [prefix_permissions] ( - [sid] int NOT NULL, + [id] int NOT NULL IDENTITY (1,1) PRIMARY KEY, + [entity] varchar(50) NOT NULL, + [entity_id] varchar(100) NOT NULL, [uid] int NOT NULL, - [permission] varchar(20) NOT NULL, + [permission] varchar(100) NOT NULL, [create_p] int NOT NULL default '0', [read_p] int NOT NULL default '0', [update_p] int NOT NULL default '0', [delete_p] int NOT NULL default '0', [import_p] int NOT NULL default '0', - [export_p] int NOT NULL default '0', - PRIMARY KEY ([sid], [uid],[permission]) + [export_p] int NOT NULL default '0' ); diff --git a/installer/sql/create-mysql.sql b/installer/sql/create-mysql.sql index 70d8ab423e5..2392a07bb81 100644 --- a/installer/sql/create-mysql.sql +++ b/installer/sql/create-mysql.sql @@ -209,16 +209,19 @@ CREATE TABLE `prefix_participants` ( -- Table structure for table permissions -- CREATE TABLE `prefix_permissions` ( - `sid` int(11) NOT NULL, + `id` int(11) NOT NULL auto_increment, + `entity` varchar(50) NOT NULL, + `entity_id` varchar(100) NOT NULL, `uid` int(11) NOT NULL, - `permission` varchar(20) NOT NULL, + `permission` varchar(100) NOT NULL, `create_p` int(11) NOT NULL default '0', `read_p` int(11) NOT NULL default '0', `update_p` int(11) NOT NULL default '0', `delete_p` int(11) NOT NULL default '0', `import_p` int(11) NOT NULL default '0', `export_p` int(11) NOT NULL default '0', - PRIMARY KEY (sid, uid, permission) + PRIMARY KEY (id), + UNIQUE KEY `idxPermissions` (`entity_id`,`entity`,`permission`,`uid`) ) ENGINE=MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci; diff --git a/installer/sql/create-pgsql.sql b/installer/sql/create-pgsql.sql index 7c55c9b905c..5478e8c52d4 100644 --- a/installer/sql/create-pgsql.sql +++ b/installer/sql/create-pgsql.sql @@ -214,16 +214,18 @@ CREATE TABLE prefix_participants ( -- Table structure for table permissions -- CREATE TABLE prefix_permissions ( - sid integer NOT NULL, + id serial NOT NULL, + entity varying(50) NOT NULL, + entity_id varying(100) NOT NULL, uid integer NOT NULL, - permission character varying(20) NOT NULL, + permission character varying(100) NOT NULL, create_p integer DEFAULT 0 NOT NULL, read_p integer DEFAULT 0 NOT NULL, update_p integer DEFAULT 0 NOT NULL, delete_p integer DEFAULT 0 NOT NULL, import_p integer DEFAULT 0 NOT NULL, export_p integer DEFAULT 0 NOT NULL, - CONSTRAINT prefix_permissions_pkey PRIMARY KEY (sid,uid,permission) + CONSTRAINT prefix_permissions_pkey PRIMARY KEY (id) );