Fix: database compatibility

This commit is contained in:
Laurent Destailleur 2012-09-27 23:43:58 +02:00
parent e94ddde91d
commit 49e79a2c28
9 changed files with 23 additions and 24 deletions

View File

@ -17,10 +17,10 @@
-- ===================================================================
CREATE TABLE llx_osc_categories (
rowid int(11) unsigned NOT NULL auto_increment,
dolicatid int(11) NOT NULL default '0',
osccatid int(11) NOT NULL default '0',
rowid integer unsigned NOT NULL auto_increment,
dolicatid integer NOT NULL default '0',
osccatid integer NOT NULL default '0',
PRIMARY KEY (rowid),
UNIQUE KEY dolicatid (dolicatid),
UNIQUE KEY osccatid (osccatid)
) ENGINE=InnoDB COMMENT='Correspondance categorie Dolibarr categorie OSC';
) ENGINE=InnoDB;

View File

@ -17,9 +17,9 @@
-- ===================================================================
CREATE TABLE llx_osc_customer (
rowid int(11) NOT NULL default '0',
rowid integer NOT NULL default '0',
datem datetime default NULL,
fk_soc int(11) NOT NULL default '0',
fk_soc integer NOT NULL default '0',
PRIMARY KEY (rowid),
UNIQUE KEY fk_soc (fk_soc)
) ENGINE=InnoDB COMMENT='Table transition client OSC - societe Dolibarr';
) ENGINE=InnoDB;

View File

@ -17,9 +17,9 @@
-- ===================================================================
CREATE TABLE llx_osc_order (
rowid int(11) NOT NULL default '0',
rowid integer NOT NULL default '0',
datem datetime default NULL,
fk_commande int(11) NOT NULL default '0',
fk_commande integer NOT NULL default '0',
PRIMARY KEY (rowid),
UNIQUE KEY fk_commande (fk_commande)
) ENGINE=InnoDB COMMENT='Table transition commande OSC - commande Dolibarr';
) ENGINE=InnoDB;

View File

@ -17,11 +17,11 @@
-- ===================================================================
CREATE TABLE llx_osc_product (
rowid int(11) NOT NULL default '0',
rowid integer NOT NULL default '0',
datem datetime default NULL,
fk_product int(11) NOT NULL default '0',
fk_product integer NOT NULL default '0',
PRIMARY KEY (rowid),
UNIQUE KEY fk_product (fk_product)
) ENGINE=InnoDB COMMENT='Table transition produit OSC - produit Dolibarr';
) ENGINE=InnoDB;

View File

@ -4,7 +4,7 @@
-- when current version is 2.6.0 or higher.
--
alter table llx_tmp_caisse modify fk_tva int(11) NOT NULL;
alter table llx_tmp_caisse modify fk_tva integer NOT NULL;
drop table llx_facture_stats;
drop table llx_stock_valorisation;

View File

@ -61,23 +61,23 @@ ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur;
ALTER TABLE llx_product_fournisseur_price ADD charges DOUBLE( 24, 8 ) DEFAULT 0 AFTER unitprice;
ALTER TABLE llx_product_fournisseur_price ADD unitcharges DOUBLE( 24, 8 ) DEFAULT 0 AFTER charges;
alter table llx_commandedet add column fk_product_fournisseur_price int(11) after info_bits;
alter table llx_commandedet add column fk_product_fournisseur_price integer after info_bits;
alter table llx_commandedet add column buy_price_ht double(24,8) DEFAULT 0 after fk_product_fournisseur_price;
alter table llx_commandedet drop column marge_tx;
alter table llx_commandedet drop column marque_tx;
alter table llx_facturedet add column fk_product_fournisseur_price int(11) after info_bits;
alter table llx_facturedet add column fk_product_fournisseur_price integer after info_bits;
alter table llx_facturedet add column buy_price_ht double(24,8) DEFAULT 0 after fk_product_fournisseur_price;
alter table llx_propaldet add column fk_product_fournisseur_price int(11) after info_bits;
alter table llx_propaldet add column fk_product_fournisseur_price integer after info_bits;
alter table llx_propaldet add column buy_price_ht double(24,8) DEFAULT 0 after fk_product_fournisseur_price;
alter table llx_propaldet drop column pa_ht;
alter table llx_propaldet drop column marge_tx;
alter table llx_propaldet drop column marque_tx;
ALTER TABLE llx_commande CHANGE COLUMN fk_demand_reason fk_input_reason INT(11) NULL DEFAULT NULL;
ALTER TABLE llx_propal CHANGE COLUMN fk_demand_reason fk_input_reason INT(11) NULL DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN fk_methode_commande fk_input_method INT(11) NULL DEFAULT 0;
ALTER TABLE llx_commande CHANGE COLUMN fk_demand_reason fk_input_reason integer NULL DEFAULT NULL;
ALTER TABLE llx_propal CHANGE COLUMN fk_demand_reason fk_input_reason integer NULL DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN fk_methode_commande fk_input_method integer NULL DEFAULT 0;
INSERT INTO llx_const (name, value, type, note, visible) values ('PRODUCT_CODEPRODUCT_ADDON','mod_codeproduct_leopard','yesno','Module to control product codes',0);

View File

@ -48,11 +48,10 @@ create table llx_commandedet
date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non
buy_price_ht double(24,8) DEFAULT 0, -- prix d'achat HT
fk_product_fournisseur_price int(11) DEFAULT NULL, -- reference prix fournisseur
fk_product_fournisseur_price integer DEFAULT NULL, -- reference prix fournisseur
special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0,
import_key varchar(14)
)ENGINE=innodb;
--

View File

@ -49,7 +49,7 @@ create table llx_facturedet
date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non
buy_price_ht double(24,8) DEFAULT 0, -- prix d'achat HT
fk_product_fournisseur_price int(11) DEFAULT NULL, -- reference prix fournisseur
fk_product_fournisseur_price integer DEFAULT NULL, -- reference prix fournisseur
fk_code_ventilation integer DEFAULT 0 NOT NULL,
fk_export_compta integer DEFAULT 0 NOT NULL,
special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales

View File

@ -48,7 +48,7 @@ create table llx_propaldet
info_bits integer DEFAULT 0, -- TVA NPR ou non
buy_price_ht double(24,8) DEFAULT 0, -- prix d'achat HT
fk_product_fournisseur_price int(11) DEFAULT NULL, -- reference prix fournisseur
fk_product_fournisseur_price integer DEFAULT NULL, -- reference prix fournisseur
special_code integer DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0 -- ordre affichage sur la propal