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

Fix pb with postgresql

parent 80646593
No related branches found
No related tags found
No related merge requests found
...@@ -137,8 +137,8 @@ class modReceiptPrinter extends DolibarrModules ...@@ -137,8 +137,8 @@ class modReceiptPrinter extends DolibarrModules
// Clean before activation // Clean before activation
$this->remove($options); $this->remove($options);
$sql = array( $sql = array(
"CREATE TABLE IF NOT EXISTS llx_printer_receipt (rowid int(11) NOT NULL AUTO_INCREMENT, name varchar(128), fk_type int(11), fk_profile int(11), parameter varchar(128), entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;", "CREATE TABLE IF NOT EXISTS llx_printer_receipt (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), fk_type integer, fk_profile integer, parameter varchar(128), entity integer) ENGINE=innodb;",
"CREATE TABLE IF NOT EXISTS llx_printer_receipt_template (rowid int(11) NOT NULL AUTO_INCREMENT, name varchar(128), template text, entity int(11), PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;", "CREATE TABLE IF NOT EXISTS llx_printer_receipt_template (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), template text, entity integer) ENGINE=innodb;",
); );
return $this->_init($sql,$options); return $this->_init($sql,$options);
} }
......
-- --
-- Be carefull to requests order. -- Be carefull to requests order.
-- 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 3.8.0 or higher. -- when current version is 5.0.0 or higher.
-- --
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; -- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
...@@ -9,14 +9,20 @@ ...@@ -9,14 +9,20 @@
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); -- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; -- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
-- To restrict request to Mysql version x.y or more: -- VMYSQLx.y -- To drop an index: -- VMYSQL4.0 DROP INDEX nomindex on llx_table
-- To restrict request to Pgsql version x.y or more: -- VPGSQLx.y -- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex
-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; -- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- To set a field as DEFAULT NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; -- To make pk to be auto increment (postgres): -- VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
-- To delete orphelins: VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); -- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL;
-- To delete orphelins: VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL;
-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL;
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
-- Note: fields with type BLOB/TEXT can't have default value.
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
UPDATE llx_facture_fourn set ref=rowid where ref IS NULL; UPDATE llx_facture_fourn set ref=rowid where ref IS NULL;
...@@ -35,6 +41,7 @@ ALTER TABLE llx_societe_rib ADD COLUMN frstrecur varchar(16) DEFAULT 'FRST' AFTE ...@@ -35,6 +41,7 @@ ALTER TABLE llx_societe_rib ADD COLUMN frstrecur varchar(16) DEFAULT 'FRST' AFTE
ALTER TABLE llx_cronjob ADD COLUMN entity integer DEFAULT 0; ALTER TABLE llx_cronjob ADD COLUMN entity integer DEFAULT 0;
ALTER TABLE llx_cronjob MODIFY COLUMN params text NULL; ALTER TABLE llx_cronjob MODIFY COLUMN params text NULL;
-- VPGSQL8.2 ALTER TABLE llx_cronjob ALTER COLUMN params DROP NOT NULL;
-- Loan -- Loan
create table llx_loan create table llx_loan
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment