From 947af2341b92b8e35584c36d095d071e39adf75e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Apr 2009 14:43:34 +0000 Subject: [PATCH] Fix: entity is in key so must be after unique key. --- mysql/migration/2.5.0-2.6.0.sql | 6 +++--- mysql/tables/llx_const.sql | 6 +++--- mysql/tables/llx_user.sql | 8 ++++---- mysql/tables/llx_usergroup.sql | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql/migration/2.5.0-2.6.0.sql b/mysql/migration/2.5.0-2.6.0.sql index 131ca3ff749..74620f1b031 100644 --- a/mysql/migration/2.5.0-2.6.0.sql +++ b/mysql/migration/2.5.0-2.6.0.sql @@ -124,9 +124,9 @@ ALTER TABLE llx_categorie_association ADD UNIQUE INDEX uk_categorie_association ALTER TABLE llx_categorie_association ADD UNIQUE INDEX uk_categorie_association_fk_categorie_fille (fk_categorie_fille); -- Multi company -ALTER TABLE llx_const ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER tms; -ALTER TABLE llx_user ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER lang; -ALTER TABLE llx_usergroup ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER note; +ALTER TABLE llx_const ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER name; +ALTER TABLE llx_user ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER login; +ALTER TABLE llx_usergroup ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER nom; ALTER TABLE llx_const DROP INDEX name; ALTER TABLE llx_user DROP INDEX uk_user_login; diff --git a/mysql/tables/llx_const.sql b/mysql/tables/llx_const.sql index f9ea667fee5..f414164abb4 100644 --- a/mysql/tables/llx_const.sql +++ b/mysql/tables/llx_const.sql @@ -1,7 +1,7 @@ -- ============================================================================ -- Copyright (C) 2001-2002 Rodolphe Quiedeville -- Copyright (C) 2003 Jean-Louis Bergamo --- Copyright (C) 2008 Laurent Destailleur +-- Copyright (C) 2008-2009 Laurent Destailleur -- Copyright (C) 2009 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify @@ -29,12 +29,12 @@ create table llx_const ( rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(255), + entity integer DEFAULT 1 NOT NULL, -- multi company id value text, -- max 65535 caracteres type varchar(6), visible tinyint DEFAULT 1 NOT NULL, note text, - tms timestamp, - entity integer DEFAULT 1 NOT NULL -- multi company id + tms timestamp ) type=innodb; -- diff --git a/mysql/tables/llx_user.sql b/mysql/tables/llx_user.sql index 5faa9c41dc4..ce804d005ae 100644 --- a/mysql/tables/llx_user.sql +++ b/mysql/tables/llx_user.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2001-2003 Rodolphe Quiedeville --- Copyright (C) 2006-2007 Laurent Destailleur +-- Copyright (C) 2006-2009 Laurent Destailleur -- Copyright (C) 2007-2009 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify @@ -26,6 +26,7 @@ create table llx_user datec datetime, tms timestamp, login varchar(24) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id pass varchar(32), pass_crypted varchar(128), pass_temp varchar(32), -- temporary password when asked for forget password @@ -49,9 +50,8 @@ create table llx_user datepreviouslogin datetime, egroupware_id integer, ldap_sid varchar(255) DEFAULT NULL, - statut tinyint DEFAULT 1, - lang varchar(6), - entity integer DEFAULT 1 NOT NULL -- multi company id + statut tinyint DEFAULT 1, + lang varchar(6) )type=innodb; -- diff --git a/mysql/tables/llx_usergroup.sql b/mysql/tables/llx_usergroup.sql index fca9b3da33a..4c004514fb4 100644 --- a/mysql/tables/llx_usergroup.sql +++ b/mysql/tables/llx_usergroup.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2005 Rodolphe Quiedeville --- Copyright (C) 2005 Laurent Destailleur +-- Copyright (C) 2005-2009 Laurent Destailleur -- Copyright (C) 2005-2009 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify @@ -23,11 +23,11 @@ create table llx_usergroup ( rowid integer AUTO_INCREMENT PRIMARY KEY, + nom varchar(255) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id datec datetime, tms timestamp, - nom varchar(255) NOT NULL, - note text, - entity integer DEFAULT 1 NOT NULL -- multi company id + note text )type=innodb; --