From b365f7dfd289a6c7b82db64c9af0ef37dc2d8f77 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Mon, 8 Aug 2011 16:07:33 +0000
Subject: [PATCH] Fix: uniformize fields name with standard extrafields

---
 htdocs/install/mysql/migration/3.0.0-3.1.0.sql         |  5 ++++-
 .../install/mysql/tables/llx_advanced_extrafields.sql  | 10 ++++++----
 .../mysql/tables/llx_advanced_extrafields_options.sql  |  7 +++----
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql
index bae240b5ed5..1db0fe41fb9 100755
--- a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql
+++ b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql
@@ -1,5 +1,5 @@
 --
--- $Id: 3.0.0-3.1.0.sql,v 1.85 2011/08/03 10:55:39 simnandez Exp $
+-- $Id: 3.0.0-3.1.0.sql,v 1.86 2011/08/08 16:07:33 hregis Exp $
 --
 -- Be carefull to requests order.
 -- This file must be loaded by calling /install/index.php page
@@ -483,3 +483,6 @@ ALTER TABLE llx_don ADD   phone           varchar(24) after email;
 
 ALTER TABLE llx_user ADD civilite varchar(6) after entity;
 
+ALTER TABLE llx_advanced_extrafields_options DROP COLUMN tms;
+ALTER TABLE llx_advanced_extrafields_options CHANGE COLUMN rang pos integer;
+ALTER TABLE llx_advanced_extrafields CHANGE COLUMN rang pos integer;
diff --git a/htdocs/install/mysql/tables/llx_advanced_extrafields.sql b/htdocs/install/mysql/tables/llx_advanced_extrafields.sql
index ade41da746e..02344d027e4 100755
--- a/htdocs/install/mysql/tables/llx_advanced_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_advanced_extrafields.sql
@@ -1,5 +1,5 @@
 -- ===================================================================
--- Copyright (C) 2010 Regis Houssin  <regis@dolibarr.fr>
+-- Copyright (C) 2010-2011 Regis Houssin  <regis@dolibarr.fr>
 --
 -- This program is free software; you can redistribute it and/or modify
 -- it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
 -- You should have received a copy of the GNU General Public License
 -- along with this program. If not, see <http://www.gnu.org/licenses/>.
 --
--- $Id: llx_advanced_extrafields.sql,v 1.2 2011/08/03 01:25:29 eldy Exp $
+-- $Id: llx_advanced_extrafields.sql,v 1.3 2011/08/08 16:07:33 hregis Exp $
 -- ===================================================================
 
 create table llx_advanced_extrafields
@@ -26,9 +26,11 @@ create table llx_advanced_extrafields
   elementtype			varchar(64) NOT NULL,           -- type of link 'invoice', 'order', 'proposal', 'invoice_supplier', 'order_supplier'
   name 					varchar(64) NOT NULL,           -- code name of field
   label					varchar(64) NOT NULL,
-  format				varchar(8) 	NOT NULL,           -- date, string, integer, float
+  type					varchar(8) 	NOT NULL,           -- date, string, integer, float
   fieldsize 			integer,
   maxlength 			integer,
   options 				varchar(255),
-  rang 					integer
+  
+  pos 					integer
+  
 )ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_advanced_extrafields_options.sql b/htdocs/install/mysql/tables/llx_advanced_extrafields_options.sql
index 015a9e9b4c0..83e830286e3 100755
--- a/htdocs/install/mysql/tables/llx_advanced_extrafields_options.sql
+++ b/htdocs/install/mysql/tables/llx_advanced_extrafields_options.sql
@@ -1,5 +1,5 @@
 -- ===================================================================
--- Copyright (C) 2010 Regis Houssin  <regis@dolibarr.fr>
+-- Copyright (C) 2010-2011 Regis Houssin  <regis@dolibarr.fr>
 --
 -- This program is free software; you can redistribute it and/or modify
 -- it under the terms of the GNU General Public License as published by
@@ -14,17 +14,16 @@
 -- You should have received a copy of the GNU General Public License
 -- along with this program. If not, see <http://www.gnu.org/licenses/>.
 --
--- $Id: llx_advanced_extrafields_options.sql,v 1.2 2011/08/03 01:25:26 eldy Exp $
+-- $Id: llx_advanced_extrafields_options.sql,v 1.3 2011/08/08 16:07:33 hregis Exp $
 -- ===================================================================
 
 create table llx_advanced_extrafields_options
 (
   rowid                 integer AUTO_INCREMENT PRIMARY KEY,
-  tms                   timestamp,
   
   fk_extrafields 		integer NOT NULL,
   value 				varchar(255) NOT NULL,
   
-  rang 					integer
+  pos 					integer
   
 )ENGINE=innodb;
-- 
GitLab