Skip to content
Snippets Groups Projects
Commit d73635c3 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Upgrade process works with Postgresql

parent 5439973b
Branches
Tags
No related merge requests found
English Dolibarr ChangeLog English Dolibarr ChangeLog
***** ChangeLog for 3.0 compared to 2.9 *****
For users:
- New: When sending supplier orders by mail, a text is predefined.
- New: Upgrade process works with Postgresql.
For developer:
- Qual: Renamed some fields into database to be more internationnal.
***** ChangeLog for 2.9 compared to 2.8 ***** ***** ChangeLog for 2.9 compared to 2.8 *****
For users: For users:
......
...@@ -5,13 +5,17 @@ ...@@ -5,13 +5,17 @@
-- This file must be loaded by calling /install/index.php page -- This file must be loaded by calling /install/index.php page
-- when current version is 2.8.0 or higher. -- when current version is 2.8.0 or higher.
-- --
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
-- To rename a column: ALTER TABLE llx_table CHANGE oldname newname varchar(60);
-- To change type of field: ALTER TABLE llx_table MODIFY name varchar(60);
--
-- Add recuperableonly field
alter table llx_product add column recuperableonly integer NOT NULL DEFAULT '0' after tva_tx; alter table llx_product add column recuperableonly integer NOT NULL DEFAULT '0' after tva_tx;
alter table llx_product_price add column recuperableonly integer NOT NULL DEFAULT '0' after tva_tx; alter table llx_product_price add column recuperableonly integer NOT NULL DEFAULT '0' after tva_tx;
-- Rename envente into tosell and add tobuy
alter table llx_product change column envente tosell smallint DEFAULT 1; alter table llx_product change column envente tosell tinyint DEFAULT 1;
alter table llx_product add column tobuy smallint DEFAULT 1 after tosell; alter table llx_product add column tobuy tinyint DEFAULT 1 after tosell;
alter table llx_product_price change column envente tosell tinyint DEFAULT 1;
\ No newline at end of file
...@@ -211,6 +211,13 @@ class DoliDb ...@@ -211,6 +211,13 @@ class DoliDb
# We remove start of requests "ALTER TABLE tablexxx" if this is a DROP INDEX # We remove start of requests "ALTER TABLE tablexxx" if this is a DROP INDEX
$line=preg_replace('/ALTER TABLE [a-z0-9_]+ DROP INDEX/i','DROP INDEX',$line); $line=preg_replace('/ALTER TABLE [a-z0-9_]+ DROP INDEX/i','DROP INDEX',$line);
# Translate order to rename fields
if (preg_match('/ALTER TABLE ([a-z0-9_]+) CHANGE COLUMN ([a-z0-9_]+) ([a-z0-9_]+)(.*)$/i',$line,$reg))
{
$line = "-- ".$line." replaced by --\n";
$line.= "ALTER TABLE ".$reg[1]." RENAME COLUMN ".$reg[2]." TO ".$reg[3];
}
# alter table add primary key (field1, field2 ...) -> We remove the primary key name not accepted by PostGreSQL # alter table add primary key (field1, field2 ...) -> We remove the primary key name not accepted by PostGreSQL
# ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY pk_dolibarr_modules (numero, entity); # ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY pk_dolibarr_modules (numero, entity);
if (preg_match('/ALTER\s+TABLE\s*(.*)\s*ADD\s+PRIMARY\s+KEY\s*(.*)\s*\((.*)$/i',$line,$reg)) if (preg_match('/ALTER\s+TABLE\s*(.*)\s*ADD\s+PRIMARY\s+KEY\s*(.*)\s*\((.*)$/i',$line,$reg))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment