diff --git a/build/dolibarr_mysql2pgsql.pl b/build/dolibarr_mysql2pgsql.pl new file mode 100644 index 00000000000..105d538292e --- /dev/null +++ b/build/dolibarr_mysql2pgsql.pl @@ -0,0 +1,281 @@ +#!/usr/bin/perl -w +#------------------------------------------------------------------------------ +# Ce script est une version modifiée de mysql2pgsql afin de: +# - gérer les base mysql innodb +# - traiter tous les fichiers ../mysq/data/*.sql vers ./pgsql/data +# - gérer les autoincrement en SERIAL plutot qu'en séquenceurs +# - utiliser le CHECK plutot que des sous-tables pour les types enum +# - corriger de nombreux bugs +#------------------------------------------------------------------------------ +use Data::Dumper; +use Getopt::Long; +use strict; + +use vars qw/ $DIR $PROG $Extension $SOURCE $DESTI %filelist /; + +# command line options +my( $opt_debug, $opt_help); +# general values +my ($out, $size); +# variables for constructing pre-create-table entities +my $create_sql=''; # if empty we are not making a create statement +my $create_index=''; # if empty we are not making a create statement +my %enum_datafield=(); # holds enumeration choices +my (@column_values,$enum_column, $seq); +my $table=""; + + + +#------------------------------------------------------------------------------ +# MAIN +#------------------------------------------------------------------------------ +($DIR=$0) =~ s/([^\/\\]+)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; +$DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/; + +$SOURCE="$DIR/../mysql/tables"; +$DESTI="$DIR/../pgsql/tables"; + +# Recherche tous les fichiers .sql +opendir(DIR, $SOURCE); + foreach my $file (readdir(DIR)) { + if ($file =~ /\.sql$/ && -f "$SOURCE/$file") { + print "Found file $file\n"; + $filelist{$file}=1; + } + } +closedir(DIR); + + +# Boucle sur tous les fichiers de SOURCE +#--------------------------------------- +foreach my $file (keys %filelist) { + + $ARGV[0]="$SOURCE/$file"; + $ARGV[1]="$DESTI/$file"; + + print "Convert file $ARGV[0] into $ARGV[1]\n"; + + # MySQL to PostgreSQL dump file converter + # + # For usage: perl mysql2pgsql.perl --help + # + # homepage: http://www.rot13.org/~dpavlin/projects.html + # 1999-12-15 DbP -- Dobrica Pavlinusic + # 1999-12-26 DbP don't make serial from auto_increment, create all manually + # (to set start value right) + # 2000-01-11 DbP now creates sequences with correct value + # 2000-04-25 DbP import into CVS (at cvs.linux.hr) + # 2001-01-29 tpo -- Tomas Pospisek : + # 1) make script comply to usage: + # 2) make script output to STDOUT instead of STERR + # 3) change verbosity behaveour + # 4) add debug option + # see rest of changelog at http://cvs.linux.hr/cvsweb.cgi/sql/mysql2pgsql + # 2003-12-16 jsp -- Joe Speigle : + # converts: s/\) *Type=MyISAM;/);/i, enum data type -> references, + # auto_increment->sequences + # 2004-01-13 jsp -- moved project to gborg; both the above declined ownership + # 2004-06-29 converts: year(4), year(2) + # homepage: gborg.postgresql.org + + GetOptions("debug", "help"); + + my $DEBUG = $opt_debug || 0; + my $HELP = $opt_help || 0; + + + if (($HELP) || ! defined($ARGV[0]) || ! defined($ARGV[1])) { + print "Usage: perl $0 {--verbose|--help|--debug} mysql_dump_file.sql pg_dump_file.sql\n"; + print "\t* OPTIONS\n"; + print "\t--verbose tees to pg_dump_file.sql and STDOUT during conversion\n"; + print "\t--debug does ?? \n"; + print "\t--help prints this message \n"; + print "\t* REQUIRED ARGUMENTS\n"; + if (defined ($ARGV[0])) { + print "\tmysql_dump_file.sql ($ARGV[0])\n"; + } else { + print "\tmysql_dump_file.sql (undefined)\n"; + } + if (defined ($ARGV[1])) { + print "\tpg_dump_file.sql ($ARGV[1])\n"; + } else { + print "\tpg_dump_file.sql (undefined)\n"; + } + exit 1; + } + + open(IN,"<$ARGV[0]") || die "can't open mysql dump file $ARGV[0]"; + open(OUT,">$ARGV[1]") || die "can't open pg dump file $ARGV[1]"; + print OUT "-- Generated from $PROG\n"; + print OUT "-- (c) 2004, PostgreSQL Inc.\n"; + print OUT "-- (c) 2005, Laurent Destailleur.\n"; + print OUT "\n"; + + sub output_create { + print OUT $create_sql; + if ($create_index) { + print OUT "\n"; + print OUT $create_index; + } + } + + # reset when moving from each "create table" to "insert" part of dump + sub reset_vars() { + $create_sql=""; + $create_index=""; + %enum_datafield=(); + $enum_column=''; + } + + + # Boucle sur contenu fichier source + #---------------------------------- + while() { + + # comments or empty lines + if (/^#/ || /^$/ || /^--/) { + print OUT $_; + next; + } + if (/^USE\s*([^;]*);/) { + print OUT "\\c ". $1; + next; + } + if ($create_sql ne "") { # we are inside create table statement so lets process datatypes + if (/\);/i) { # end of create table squence + $create_sql =~ s/,$//g; # strip last , inside create table + &output_create; + &reset_vars(); + next; + # LDR Added innodb + } elsif (/(ISAM|innodb)/i) { # end of create table sequence + s/\) *Type=(MyISAM|innodb);/);/i; + $create_sql =~ s/,$//g; # strip last , inside create table + $create_sql .= $_; + &output_create; + &reset_vars(); + next; + } + if (/(\w*)\s+enum\(((?:['"]\w+['"]\s*,)+['"]\w+['"])\)(.*)$/i) { # enum handling + $enum_column=$1; + $enum_datafield{$enum_column} = $2; # 'abc','def', ... + my $maxlength=0; + foreach my $enum (split(',',$2)) { + $enum =~ s/[\"\']//g; + if ($maxlength serial + $seq = qq~${table}_${1}_seq~; + s/[\s\t]*([a-zA-Z_0-9]*)\s*.*int.*auto_increment[^,]*/ $1 SERIAL PRIMARY KEY/ig; + # MYSQL: data_id mediumint(8) unsigned NOT NULL auto_increment, + $create_sql.=$_; + next; + # int type conversion + } elsif (/(\w*)int\(\d+\)/i) { + $size=$1; + $size =~ tr [A-Z] [a-z]; + if ($size eq "tiny" || $size eq "small") { + $out = "int2"; + } elsif ($size eq "big") { + $out = "int8"; + } else { + $out = "int4"; + } + s/\w*int\(\d+\)/$out/g; + } + + # nuke int unsigned + s/(int\w+)\s+unsigned/$1/gi; + + # blob -> text + s/\w*blob/text/gi; + # tinytext/mediumtext -> text + s/tinytext/text/gi; + s/mediumtext/text/gi; + + # char -> varchar + # PostgreSQL would otherwise pad with spaces as opposed + # to MySQL! Your user interface may depend on this! + s/(\s+)char/${1}varchar/gi; + + # nuke date representation (not supported in PostgreSQL) + s/datetime default '[^']+'/datetime/i; + s/date default '[^']+'/datetime/i; + s/time default '[^']+'/datetime/i; + + # change not null datetime field to null valid ones + # (to support remapping of "zero time" to null + s/datetime not null/datetime/i; + + # nuke size of timestamp + s/timestamp\([^)]*\)/timestamp/i; + + # double -> float8 + s/double\([^)]*\)/float8/i; + + # add unique to definition of type (MySQL separates this) + if (/unique \w+ \((\w+)\)/i) { + $create_sql.=~s/($1)([^,]+)/$1$2 unique/i; + next; + } + # FIX: unique for multipe columns (col1,col2) are unsupported! + next if (/unique/i); + + if (/\bkey\b/i && !/^\s+primary key\s+/i) { + s/KEY(\s+)[^(]*(\s+)/$1 UNIQUE $2/i; # hack off name of the non-primary key + } + + # if key(xxx), + if (/key\((\w+)\)/) { + $create_index .= "CREATE INDEX ${table}_$1 ON $table ($1);\n"; + next; + } + + # quote column names + s/(^\s*)([^\s\-\(]+)(\s*)/$1"$2"$3/gi if (!/\bkey\b/i); + + # remap colums with names of existing system attribute + if (/"oid"/i) { + s/"oid"/"_oid"/g; + print STDERR "WARNING: table $table uses column \"oid\" which is renamed to \"_oid\"\nYou should fix application manually! Press return to continue."; + my $wait=; + } + s/oid/_oid/i if (/key/i && /oid/i); # fix oid in key + $create_sql.=$_; + } # END of if ($create_sql ne "") i.e. were inside create table statement so processed datatypes + else { # not inside create table + #---- fix data in inserted data: (from MS world) + # FIX: disabled for now + if (00 && /insert into/i) { + s!\x96!-!g; # -- + s!\x93!"!g; # `` + s!\x94!"!g; # '' + s!\x85!... !g; # \ldots + s!\x92!`!g; + } + + # fix dates '0000-00-00 00:00:00' (should be null) + s/'0000-00-00 00:00:00'/null/gi; + s/'0000-00-00'/null/gi; + s/'00:00:00'/null/gi; + s/([12]\d\d\d)([01]\d)([0-3]\d)([0-2]\d)([0-6]\d)([0-6]\d)/'$1-$2-$3 $4:$5:$6'/; + + if (/create\s+table\s+(\w+)/i) { + $create_sql = $_; + /create\s*table\s*(\w+)/i; + $table=$1 if (defined($1)); + } else { + print OUT $_; + } + } # end of if inside create_table + } # END while() + + close IN; + close OUT; + +} + +print "Build ".(scalar keys %filelist)." file(s).\n"; + +0; \ No newline at end of file diff --git a/pgsql/tables/llx_action_def.sql b/pgsql/tables/llx_action_def.sql index 7635e707d85..f4d84cc8327 100644 --- a/pgsql/tables/llx_action_def.sql +++ b/pgsql/tables/llx_action_def.sql @@ -1,32 +1,36 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- Copyright (C) 2004 Guillaume Delecourt --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_action_def -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - titre varchar(255) NOT NULL, - description text, - objet_type CHAR(10) CHECK (objet_type IN ('ficheinter','facture','propale','mailing')) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Benoit Mortier +-- Copyright (C) 2004 Guillaume Delecourt +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_action_def +( + rowid integer NOT NULL PRIMARY KEY, + "tms" timestamp, + "titre" varchar(255) NOT NULL, + "description" text, + "objet_type" varchar(10) CHECK (objet_type IN ('ficheinter','facture','propale','mailing')) +); diff --git a/pgsql/tables/llx_actioncomm.sql b/pgsql/tables/llx_actioncomm.sql index be36d25936f..71379281bfb 100644 --- a/pgsql/tables/llx_actioncomm.sql +++ b/pgsql/tables/llx_actioncomm.sql @@ -1,45 +1,48 @@ --- ======================================================================== --- Copyright (C) 2001-2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- Actions commerciales --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_actioncomm -( - id SERIAL PRIMARY KEY, - datea timestamp without time zone, -- action date - fk_action integer, - label varchar(50), -- libelle de l'action - fk_soc integer, - fk_contact integer default 0, - fk_user_action integer, -- id de la personne qui doit effectuer l'action - fk_user_author integer, - priority smallint, - percent smallint, - note text, - propalrowid integer, - fk_facture integer -); - - - - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2003 Rodolphe Quiedeville +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- Actions commerciales +-- +-- ======================================================================== + +create table llx_actioncomm +( + id SERIAL PRIMARY KEY, + "datea" timestamp, -- action date + "fk_action" integer, + "label" varchar(50), -- libelle de l'action + "fk_soc" integer, + "fk_contact" integer default 0, + "fk_user_action" integer, -- id de la personne qui doit effectuer l'action + "fk_user_author" integer, + "priority" smallint, + "percent" smallint, + "note" text, + "propalrowid" integer, + "fk_facture" integer +); + + + + diff --git a/pgsql/tables/llx_adherent.sql b/pgsql/tables/llx_adherent.sql index e7de3bb0e52..69457de8cf9 100644 --- a/pgsql/tables/llx_adherent.sql +++ b/pgsql/tables/llx_adherent.sql @@ -1,56 +1,60 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortiero --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - --- statut --- 0 : non adherent --- 1 : adherent - -create table llx_adherent -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - statut smallint NOT NULL DEFAULT 0, - public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ? - fk_adherent_type smallint, - morphy CHAR(3) CHECK (morphy IN ('mor','phy')) NOT NULL, -- personne morale / personne physique - datevalid timestamp without time zone, -- date de validation - datec timestamp without time zone, -- date de creation - prenom varchar(50), - nom varchar(50), - societe varchar(50), - adresse text, - cp varchar(30), - ville varchar(50), - pays varchar(50), - email varchar(255), - login varchar(50) NOT NULL, -- login utilise pour editer sa fiche - pass varchar(50), -- pass utilise pour editer sa fiche - naiss date, -- date de naissance - photo varchar(255), -- url vers la photo de l'adherent - fk_user_author integer NOT NULL, - fk_user_mod integer NOT NULL, - fk_user_valid integer NOT NULL, - datefin timestamp without time zone NOT NULL, -- date de fin de validité de la cotisation - note text -); - -CREATE UNIQUE INDEX llx_adherent_login ON llx_adherent (login); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2002-2004 Rodolphe Quiedeville +-- Copyright (C) 2002-2003 Jean-Louis Bergamo +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== +-- +-- statut +-- 0 : non adherent +-- 1 : adherent + +create table llx_adherent +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "statut" smallint NOT NULL DEFAULT 0, + "public" smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ? + "fk_adherent_type" smallint, + "morphy" varchar(3) CHECK (morphy IN ('mor','phy')) NOT NULL, -- personne morale / personne physique + "datevalid" datetime, -- date de validation + "datec" datetime, -- date de creation + "prenom" varchar(50), + "nom" varchar(50), + "societe" varchar(50), + "adresse" text, + "cp" varchar(30), + "ville" varchar(50), + "pays" varchar(50), + "email" varchar(255), + "login" varchar(50) NOT NULL, -- login utilise pour editer sa fiche + "pass" varchar(50), -- pass utilise pour editer sa fiche + "naiss" date, -- date de naissance + "photo" varchar(255), -- url vers la photo de l'adherent + "fk_user_author" integer NOT NULL, + "fk_user_mod" integer NOT NULL, + "fk_user_valid" integer NOT NULL, + "datefin" datetime, -- date de fin de validité de la cotisation + "note" text, + +); diff --git a/pgsql/tables/llx_adherent_options.sql b/pgsql/tables/llx_adherent_options.sql index bf1a459f3a1..cecee399716 100644 --- a/pgsql/tables/llx_adherent_options.sql +++ b/pgsql/tables/llx_adherent_options.sql @@ -1,34 +1,36 @@ --- =================================================================== --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Jean-Louis Bergamo --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_adherent_options -( - optid SERIAL PRIMARY KEY, - tms timestamp, - adhid integer NOT NULL -- id de l'adherent auquel correspond ces attributs optionnel --- telfixe varchar(15), --- teljob varchar(15) -); - -CREATE UNIQUE INDEX llx_adherent_options_adhid ON llx_adherent_options (adhid); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2002-2003 Jean-Louis Bergamo +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +-- telfixe varchar(15), +-- teljob varchar(15) + +create table llx_adherent_options +( + optid SERIAL PRIMARY KEY, + "tms" timestamp, + "adhid" integer NOT NULL, -- id de l'adherent auquel correspond ces attributs optionnel +); diff --git a/pgsql/tables/llx_adherent_options_label.sql b/pgsql/tables/llx_adherent_options_label.sql index 2751012f087..fdb5b16b09b 100644 --- a/pgsql/tables/llx_adherent_options_label.sql +++ b/pgsql/tables/llx_adherent_options_label.sql @@ -1,30 +1,33 @@ --- =================================================================== --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Jean-Louis Bergamo --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_adherent_options_label -( - name varchar(64) PRIMARY KEY, -- nom de l'attribut - tms timestamp, - label varchar(255) NOT NULL -- label correspondant a l'attribut -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2002-2003 Jean-Louis Bergamo +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_adherent_options_label +( + name varchar(64) PRIMARY KEY, -- nom de l'attribut + "tms" timestamp, + "label" varchar(255) NOT NULL -- label correspondant a l'attribut +); diff --git a/pgsql/tables/llx_adherent_type.sql b/pgsql/tables/llx_adherent_type.sql index 595af89ac10..c7d502c589d 100644 --- a/pgsql/tables/llx_adherent_type.sql +++ b/pgsql/tables/llx_adherent_type.sql @@ -1,38 +1,42 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - --- statut --- 0 : actif --- 1 : inactif - - -create table llx_adherent_type -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - statut smallint NOT NULL DEFAULT 0, - libelle varchar(50), - cotisation CHAR(3) CHECK (cotisation IN ('yes','no')) NOT NULL DEFAULT 'yes', - vote CHAR(3) CHECK (vote IN ('yes','no')) NOT NULL DEFAULT 'yes', - note text, - mail_valid text -- mail envoye a la validation -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2002-2003 Jean-Louis Bergamo +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== +-- +-- statut +-- 0 : actif +-- 1 : inactif + +create table llx_adherent_type +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "statut" smallint NOT NULL DEFAULT 0, + "libelle" varchar(50), + "cotisation" varchar(3) CHECK (cotisation IN ('yes','no')) NOT NULL DEFAULT 'yes', + "vote" varchar(3) CHECK (vote IN ('yes','no')) NOT NULL DEFAULT 'yes', + "note" text, + "mail_valid" text -- mail envoye a la validation +); diff --git a/pgsql/tables/llx_album.sql b/pgsql/tables/llx_album.sql index ad3754ff491..0b17c1be225 100644 --- a/pgsql/tables/llx_album.sql +++ b/pgsql/tables/llx_album.sql @@ -1,35 +1,39 @@ --- ============================================================================ --- Copyright (C) 2004 Benoit mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_album -( - rowid serial PRIMARY KEY, - osc_id integer NOT NULL, - tms timestamp, - ref varchar(12), - title varchar(64), - annee smallint, - description text, - collectif smallint, - fk_user_author integer -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_album +( + rowid SERIAL PRIMARY KEY, + "osc_id" integer NOT NULL, + "tms" timestamp, + "ref" varchar(12), + "title" varchar(64), + "annee" int2, + "description" text, + "collectif" tinyint, + "fk_user_author" integer +); + diff --git a/pgsql/tables/llx_album_to_groupart.sql b/pgsql/tables/llx_album_to_groupart.sql index db155f34b75..5a84ea6ca64 100644 --- a/pgsql/tables/llx_album_to_groupart.sql +++ b/pgsql/tables/llx_album_to_groupart.sql @@ -1,30 +1,33 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_album_to_groupart -( - fk_album integer NOT NULL, - fk_groupart integer NOT NULL, - - UNIQUE (fk_album, fk_groupart) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_album_to_groupart +( + "fk_album" integer NOT NULL, + "fk_groupart" integer NOT NULL +); + diff --git a/pgsql/tables/llx_appro.sql b/pgsql/tables/llx_appro.sql index bf30cc230cb..89b8229e2f3 100644 --- a/pgsql/tables/llx_appro.sql +++ b/pgsql/tables/llx_appro.sql @@ -1,34 +1,37 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_appro -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - fk_product integer NOT NULL, - quantity smallint NOT NULL, - price real, - fk_user_author integer -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_appro +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "fk_product" integer NOT NULL, + "quantity" smallint unsigned NOT NULL, + "price" real, + "fk_user_author" integer +); + diff --git a/pgsql/tables/llx_auteur.sql b/pgsql/tables/llx_auteur.sql index c0c02908592..0a7f3fbea9c 100644 --- a/pgsql/tables/llx_auteur.sql +++ b/pgsql/tables/llx_auteur.sql @@ -1,31 +1,34 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_auteur -( - rowid SERIAL PRIMARY KEY, - oscid integer NOT NULL, - tms timestamp, - nom varchar(255), - fk_user_author integer -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_auteur +( + rowid SERIAL PRIMARY KEY, + "oscid" integer NOT NULL, + "tms" timestamp, + "nom" varchar(255), + "fk_user_author" integer +); diff --git a/pgsql/tables/llx_bank.sql b/pgsql/tables/llx_bank.sql index ec041b93778..e9d73062982 100644 --- a/pgsql/tables/llx_bank.sql +++ b/pgsql/tables/llx_bank.sql @@ -1,45 +1,46 @@ --- =================================================================== --- Copyright (C) 2000-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - - -create table llx_bank -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - datev date, -- date de valeur - dateo date, -- date operation - amount real NOT NULL default 0, - label varchar(255), - fk_account integer, - fk_user_author integer, - fk_user_rappro integer, - fk_type varchar(4), -- CB, Virement, cheque - num_releve varchar(50), - num_chq int, - rappro int default 0, - note text, - - - author varchar(40) -- a supprimer apres migration -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2000-2002 Rodolphe Quiedeville +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + + + +create table llx_bank +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "datev" date, -- date de valeur + "dateo" date, -- date operation + "amount" real NOT NULL default 0, + "label" varchar(255), + "fk_account" integer, + "fk_user_author" integer, + "fk_user_rappro" integer, + "fk_type" varchar(4), -- CB, Virement, cheque + "num_releve" varchar(50), + "num_chq" int, + "rappro" tinyint default 0, + "note" text, + "author" varchar(40) -- a supprimer apres migration +); diff --git a/pgsql/tables/llx_bank_account.sql b/pgsql/tables/llx_bank_account.sql index 9f3224887b4..7882259b551 100644 --- a/pgsql/tables/llx_bank_account.sql +++ b/pgsql/tables/llx_bank_account.sql @@ -1,45 +1,51 @@ --- =================================================================== --- Copyright (C) 2000-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- Copyright (C) 2004 Laurent Destailleur --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_bank_account -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - label varchar(30), - bank varchar(60), - code_banque varchar(7), - code_guichet varchar(6), - number varchar(255), - cle_rib varchar(5), - bic varchar(10), - iban_prefix varchar(5), - domiciliation varchar(255), - proprio varchar(60), - adresse_proprio varchar(255), - courant smallint DEFAULT 0 NOT NULL, - clos smallint DEFAULT 0 NOT NULL, - account_number varchar(8) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================= +-- Copyright (C) 2000-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- +-- courant : indique si c'est un compte courant +-- clos : le compte est-il clos ou encore ouvert +-- +-- ============================================================================= + +create table llx_bank_account +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "label" varchar(30), + "bank" varchar(60), + "code_banque" varchar(7), + "code_guichet" varchar(6), + "number" varchar(255), + "cle_rib" varchar(5), + "bic" varchar(10), + "iban_prefix" varchar(5), + "domiciliation" varchar(255), + "proprio" varchar(60), + "adresse_proprio" varchar(255), + "courant" smallint DEFAULT 0 NOT NULL, + "clos" smallint DEFAULT 0 NOT NULL, + "account_number" varchar(8) +); diff --git a/pgsql/tables/llx_bank_categ.sql b/pgsql/tables/llx_bank_categ.sql index c453aa74522..ae82812d5bf 100644 --- a/pgsql/tables/llx_bank_categ.sql +++ b/pgsql/tables/llx_bank_categ.sql @@ -1,27 +1,29 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_bank_categ -( - rowid SERIAL PRIMARY KEY, - label varchar(255) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + +create table llx_bank_categ +( + rowid SERIAL PRIMARY KEY, + "label" varchar(255) +); diff --git a/pgsql/tables/llx_bank_class.sql b/pgsql/tables/llx_bank_class.sql index 9e582ff2a3f..b34c703facc 100644 --- a/pgsql/tables/llx_bank_class.sql +++ b/pgsql/tables/llx_bank_class.sql @@ -1,29 +1,31 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_bank_class -( - lineid integer NOT NULL, - fk_categ integer NOT NULL -); - -create index llx_bank_class_lineid on llx_bank_class(lineid); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + + +create table llx_bank_class +( + "lineid" integer NOT NULL, + "fk_categ" integer NOT NULL, + "INDEX"(lineid) +); diff --git a/pgsql/tables/llx_cash.sql b/pgsql/tables/llx_bank_url.key.sql similarity index 63% rename from pgsql/tables/llx_cash.sql rename to pgsql/tables/llx_bank_url.key.sql index c896d7dbf84..c37e47031e0 100644 --- a/pgsql/tables/llx_cash.sql +++ b/pgsql/tables/llx_bank_url.key.sql @@ -1,35 +1,28 @@ --- =================================================================== --- Copyright (C) 2004 Laurent Destailleur --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_cash -( - rowid serial PRIMARY KEY, - datec timestamp, - dateo date NOT NULL, -- date operation - amount real NOT NULL default 0, - label varchar(255), - fk_account integer, -- Pour gerer plusieurs caisse - fk_user_author integer, - fk_type varchar(4), -- Liquide, retrait, depot - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + + +ALTER TABLE llx_bank_url ADD UNIQUE uk_bank_url (fk_bank,url_id); \ No newline at end of file diff --git a/pgsql/tables/llx_bank_url.sql b/pgsql/tables/llx_bank_url.sql index 9b40ec3e8ca..a26c589e88c 100644 --- a/pgsql/tables/llx_bank_url.sql +++ b/pgsql/tables/llx_bank_url.sql @@ -1,31 +1,34 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_bank_url -( - rowid SERIAL PRIMARY KEY, - fk_bank integer, - url_id integer, - url varchar(255), - label varchar(255) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_bank_url +( + rowid SERIAL PRIMARY KEY, + "fk_bank" integer, + "url_id" integer, + "url" varchar(255), + "label" varchar(255) +); diff --git a/pgsql/tables/llx_bookmark.sql b/pgsql/tables/llx_bookmark.sql index 4018a56e842..74511273ac6 100644 --- a/pgsql/tables/llx_bookmark.sql +++ b/pgsql/tables/llx_bookmark.sql @@ -1,30 +1,31 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - - -create table llx_bookmark -( - rowid SERIAL PRIMARY KEY, - fk_soc integer, - fk_user integer, - dateb timestamp without time zone -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + +create table llx_bookmark +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer, + "fk_user" integer, + "dateb" datetime +); diff --git a/pgsql/tables/llx_bookmark4u_login.sql b/pgsql/tables/llx_bookmark4u_login.sql index b375ccfa8ec..ea14c8c6d9d 100644 --- a/pgsql/tables/llx_bookmark4u_login.sql +++ b/pgsql/tables/llx_bookmark4u_login.sql @@ -1,29 +1,33 @@ --- ============================================================================ --- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_bookmark4u_login -( - rowid serial PRIMARY KEY, - fk_user integer, - bk4u_uid integer -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + +create table llx_bookmark4u_login +( + rowid SERIAL PRIMARY KEY, + "fk_user" integer, + "bk4u_uid" integer +); diff --git a/pgsql/tables/llx_boxes.sql b/pgsql/tables/llx_boxes.sql index 54a86b4c76b..684004881f0 100644 --- a/pgsql/tables/llx_boxes.sql +++ b/pgsql/tables/llx_boxes.sql @@ -1,34 +1,37 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== --- --- position : 0-index.php, 1-left, 2-right --- --- - -create table llx_boxes -( - rowid SERIAL PRIMARY KEY, - box_id integer NOT NULL, - position smallint NOT NULL - -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== +-- +-- position : 0-index.php, 1-left, 2-right +-- +-- + +create table llx_boxes +( + rowid SERIAL PRIMARY KEY, + "box_id" integer NOT NULL, + "position" smallint NOT NULL, + "box_order" smallint default 0 NOT NULL +); diff --git a/pgsql/tables/llx_boxes_def.sql b/pgsql/tables/llx_boxes_def.sql index a15af1350b4..0e048dd9e3d 100644 --- a/pgsql/tables/llx_boxes_def.sql +++ b/pgsql/tables/llx_boxes_def.sql @@ -1,30 +1,33 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_boxes_def -( - rowid SERIAL PRIMARY KEY, - name varchar(255) NOT NULL, - file varchar(255) NOT NULL, - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + +create table llx_boxes_def +( + rowid SERIAL PRIMARY KEY, + "name" varchar(255) NOT NULL, + "file" varchar(255) NOT NULL, + "note" text +); diff --git a/pgsql/tables/llx_c_accountingsystem.sql b/pgsql/tables/llx_c_accountingsystem.sql index 2fcf8a3e0a5..7871f4a4ea9 100644 --- a/pgsql/tables/llx_c_accountingsystem.sql +++ b/pgsql/tables/llx_c_accountingsystem.sql @@ -1,33 +1,37 @@ --- ============================================================================ --- Copyright (C) 2004 Laurent Destailleur --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_c_accountingsystem -( - rowid SERIAL PRIMARY KEY, - fk_pays integer NOT NULL, - pcg_version varchar(12) NOT NULL, - pcg_type varchar(20) NOT NULL, - pcg_subtype varchar(20) NOT NULL, - label varchar(128) NOT NULL, - account_number varchar(20) NOT NULL -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_c_accountingsystem +( + rowid SERIAL PRIMARY KEY, + "fk_pays" integer NOT NULL, + "pcg_version" varchar(12) NOT NULL, + "pcg_type" varchar(20) NOT NULL, + "pcg_subtype" varchar(20) NOT NULL, + "label" varchar(128) NOT NULL, + "account_number" varchar(20) NOT NULL, + "account_parent" varchar(20) +); diff --git a/pgsql/tables/llx_c_actioncomm.sql b/pgsql/tables/llx_c_actioncomm.sql index d81f7a1e2cd..78f2ff31c9e 100644 --- a/pgsql/tables/llx_c_actioncomm.sql +++ b/pgsql/tables/llx_c_actioncomm.sql @@ -1,35 +1,35 @@ --- ======================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_c_actioncomm -( - id SERIAL PRIMARY KEY, - code varchar(12) UNIQUE NOT NULL, - type varchar(10) DEFAULT 'system' NOT NULL, - libelle varchar(30) NOT NULL, - active smallint DEFAULT 1 NOT NULL, - todo smallint -); - - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_actioncomm +( + id integer PRIMARY KEY, + "type" varchar(10) DEFAULT 'system' NOT NULL, + "libelle" varchar(30) NOT NULL, + "active" tinyint DEFAULT 1 NOT NULL, + "todo" tinyint +); diff --git a/pgsql/tables/llx_c_ape.sql b/pgsql/tables/llx_c_ape.sql index 06e79a3cb9b..1ee303b224f 100644 --- a/pgsql/tables/llx_c_ape.sql +++ b/pgsql/tables/llx_c_ape.sql @@ -1,31 +1,35 @@ --- ======================================================================== --- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_c_ape -( - rowid serial UNIQUE, - code_ape varchar(5) PRIMARY KEY, - libelle varchar(255), - active smallint DEFAULT 1 NOT NULL -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_ape +( + rowid SERIAL PRIMARY KEY, + code_ape varchar(5) PRIMARY KEY, + "libelle" varchar(255), + "active" tinyint DEFAULT 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_chargesociales.sql b/pgsql/tables/llx_c_chargesociales.sql index df86f98db10..2a201f3eda0 100644 --- a/pgsql/tables/llx_c_chargesociales.sql +++ b/pgsql/tables/llx_c_chargesociales.sql @@ -1,33 +1,37 @@ --- ======================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== -create table llx_c_chargesociales -( - id SERIAL PRIMARY KEY, - libelle varchar(80), - deductible integer DEFAULT 0 NOT NULL, - active integer DEFAULT 1 NOT NULL -); - - - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + +create table llx_c_chargesociales +( + id integer PRIMARY KEY, + "libelle" varchar(80), + "deductible" smallint DEFAULT 0 NOT NULL, + "active" tinyint DEFAULT 1 NOT NULL +); + + + diff --git a/pgsql/tables/llx_c_civilite.sql b/pgsql/tables/llx_c_civilite.sql index 3ef5983811d..fdae84fbe0b 100644 --- a/pgsql/tables/llx_c_civilite.sql +++ b/pgsql/tables/llx_c_civilite.sql @@ -1,29 +1,33 @@ --- ======================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- ======================================================================== - -create table llx_c_civilite -( - rowid serial PRIMARY KEY, - code varchar(6) UNIQUE NOT NULL, - civilite varchar(50), - active smallint DEFAULT 1 NOT NULL -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2004 Benoit Mortier +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- ======================================================================== + +create table llx_c_civilite +( + rowid integer PRIMARY KEY, + "civilite" varchar(50), + "active" tinyint DEFAULT 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_currencies.sql b/pgsql/tables/llx_c_currencies.sql new file mode 100644 index 00000000000..d9ca9ca84a8 --- /dev/null +++ b/pgsql/tables/llx_c_currencies.sql @@ -0,0 +1,32 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2005 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_currencies +( + "label" varchar(64), + "active" tinyint DEFAULT 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_departements.sql b/pgsql/tables/llx_c_departements.sql index 3715d8ac8e6..757a520c1b6 100644 --- a/pgsql/tables/llx_c_departements.sql +++ b/pgsql/tables/llx_c_departements.sql @@ -1,36 +1,43 @@ --- ======================================================================== --- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_c_departements -( - rowid serial PRIMARY KEY, - code_departement varchar(6) NOT NULL, - fk_region integer, - cheflieu varchar(7), - tncc integer, - ncc varchar(50), - nom varchar(50), - active smallint DEFAULT 1 NOT NULL -); - -CREATE INDEX llx_c_departements_fk_region ON llx_c_departements(fk_region); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + + +create table llx_c_departements +( + rowid SERIAL PRIMARY KEY, + "code_departement" varchar(6) NOT NULL, + "fk_region" integer, + "cheflieu" varchar(7), + "tncc" integer, + "ncc" varchar(50), + "nom" varchar(50), + "active" tinyint DEFAULT 1 NOT NULL, + key (fk_region) +); + + + diff --git a/pgsql/tables/llx_c_effectif.sql b/pgsql/tables/llx_c_effectif.sql index 12510614560..3e23ae1dc65 100644 --- a/pgsql/tables/llx_c_effectif.sql +++ b/pgsql/tables/llx_c_effectif.sql @@ -1 +1,34 @@ --- ======================================================================== -- Copyright (C) 2004 Benoit Mortier -- -- 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 -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- $Id$ -- $Source$ -- -- ======================================================================== create table llx_c_effectif ( id SERIAL PRIMARY KEY, code varchar(12) UNIQUE NOT NULL, libelle varchar(30), active integer DEFAULT 1 NOT NULL ); \ No newline at end of file +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_effectif +( + id integer PRIMARY KEY, + "libelle" varchar(30), + "active" tinyint DEFAULT 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_forme_juridique.sql b/pgsql/tables/llx_c_forme_juridique.sql index 2a947e7d95d..a2c061bb52b 100644 --- a/pgsql/tables/llx_c_forme_juridique.sql +++ b/pgsql/tables/llx_c_forme_juridique.sql @@ -1,32 +1,36 @@ --- ======================================================================== --- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_c_forme_juridique -( - rowid serial PRIMARY KEY, - code varchar(12) UNIQUE NOT NULL, - fk_pays integer NOT NULL, - libelle varchar(255), - active smallint DEFAULT 1 NOT NULL -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + + +create table llx_c_forme_juridique +( + rowid SERIAL PRIMARY KEY, + "fk_pays" integer NOT NULL, + "libelle" varchar(255), + "active" tinyint DEFAULT 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_methode_commande_fournisseur.sql b/pgsql/tables/llx_c_methode_commande_fournisseur.sql new file mode 100644 index 00000000000..636807660a2 --- /dev/null +++ b/pgsql/tables/llx_c_methode_commande_fournisseur.sql @@ -0,0 +1,35 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2005 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_methode_commande_fournisseur +( + rowid SERIAL PRIMARY KEY, + "code" varchar(30), + "libelle" varchar(30), + "active" tinyint default 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_paiement.sql b/pgsql/tables/llx_c_paiement.sql index 43ea28e4c99..610fbc6f0a0 100644 --- a/pgsql/tables/llx_c_paiement.sql +++ b/pgsql/tables/llx_c_paiement.sql @@ -1,42 +1,43 @@ --- ======================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - --- --- Type : --- --- 0 : entrée d'argent --- 1 : sortie d'argent --- 2 : entrée ou sortie d'argent - -create table llx_c_paiement -( - id SERIAL PRIMARY KEY, - code varchar(6), - libelle varchar(30), - type smallint, - active smallint DEFAULT 1 not null -); - - - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== +-- +-- Type : +-- +-- 0 : entrée d'argent +-- 1 : sortie d'argent +-- 2 : entrée ou sortie d'argent + +create table llx_c_paiement +( + id integer PRIMARY KEY, + "libelle" varchar(30), + "type" smallint, + "active" tinyint DEFAULT 1 NOT NULL +); + + + diff --git a/pgsql/tables/llx_c_pays.sql b/pgsql/tables/llx_c_pays.sql index 9945c4c98b7..1a2d44821b2 100644 --- a/pgsql/tables/llx_c_pays.sql +++ b/pgsql/tables/llx_c_pays.sql @@ -1,31 +1,35 @@ --- ======================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_c_pays -( - rowid SERIAL PRIMARY KEY, - code varchar(6) UNIQUE NOT NULL, - libelle varchar(25) NOT NULL, - active smallint DEFAULT 1 NOT NULL -); - - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_pays +( + rowid integer PRIMARY KEY, + "libelle" varchar(25) NOT NULL, + "active" tinyint DEFAULT 1 NOT NULL +); + + diff --git a/pgsql/tables/llx_c_propalst.sql b/pgsql/tables/llx_c_propalst.sql index 4624879753d..362aaac2e1b 100644 --- a/pgsql/tables/llx_c_propalst.sql +++ b/pgsql/tables/llx_c_propalst.sql @@ -1,30 +1,34 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_c_propalst -( - id SERIAL PRIMARY KEY, - code varchar(12) UNIQUE NOT NULL, - label varchar(30), - active integer DEFAULT 1 NOT NULL -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + +create table llx_c_propalst +( + id smallint PRIMARY KEY, + "label" varchar(30), + "active" tinyint DEFAULT 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_regions.key.sql b/pgsql/tables/llx_c_regions.key.sql new file mode 100644 index 00000000000..32d7f0d561c --- /dev/null +++ b/pgsql/tables/llx_c_regions.key.sql @@ -0,0 +1,28 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2005 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + + +ALTER TABLE llx_c_regions ADD CONSTRAINT c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays (rowid); diff --git a/pgsql/tables/llx_c_regions.sql b/pgsql/tables/llx_c_regions.sql index 2236a1a0a49..3483047ce42 100644 --- a/pgsql/tables/llx_c_regions.sql +++ b/pgsql/tables/llx_c_regions.sql @@ -1,34 +1,37 @@ --- ======================================================================== --- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_c_regions -( - rowid serial PRIMARY KEY, - code_region integer UNIQUE NOT NULL, - fk_pays integer NOT NULL, - cheflieu varchar(7), - tncc integer, - nom varchar(50), - active smallint DEFAULT 1 NOT NULL -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_regions +( + rowid SERIAL PRIMARY KEY, + "fk_pays" integer NOT NULL, + "cheflieu" varchar(7), + "tncc" integer, + "nom" varchar(50), + "active" tinyint DEFAULT 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_stcomm.sql b/pgsql/tables/llx_c_stcomm.sql index 63b7f1627a6..487c24be782 100644 --- a/pgsql/tables/llx_c_stcomm.sql +++ b/pgsql/tables/llx_c_stcomm.sql @@ -1,30 +1,34 @@ --- ======================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_c_stcomm -( - id SERIAL PRIMARY KEY, - code varchar(12) UNIQUE NOT NULL, - libelle varchar(30), - active smallint DEFAULT 1 NOT NULL -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_c_stcomm +( + id integer PRIMARY KEY, + "libelle" varchar(30), + "active" tinyint default 1 NOT NULL +); + diff --git a/pgsql/tables/llx_c_typent.sql b/pgsql/tables/llx_c_typent.sql index f1a508f7f11..27eb90992b6 100644 --- a/pgsql/tables/llx_c_typent.sql +++ b/pgsql/tables/llx_c_typent.sql @@ -1,29 +1,33 @@ --- ======================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_c_typent -( - id SERIAL PRIMARY KEY, - code varchar(12) UNIQUE NOT NULL, - libelle varchar(30), - active smallint DEFAULT 1 NOT NULL -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + +create table llx_c_typent +( + id integer PRIMARY KEY, + "libelle" varchar(30), + "active" tinyint DEFAULT 1 NOT NULL +); diff --git a/pgsql/tables/llx_chargesociales.sql b/pgsql/tables/llx_chargesociales.sql index db118f3d213..d92dc35c932 100644 --- a/pgsql/tables/llx_chargesociales.sql +++ b/pgsql/tables/llx_chargesociales.sql @@ -1,34 +1,40 @@ --- ======================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_chargesociales -( - rowid SERIAL PRIMARY KEY, - libelle varchar(80), - deductible smallint DEFAULT 0 NOT NULL, - active smallint DEFAULT 0 NOT NULL -); - - - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + +create table llx_chargesociales +( + rowid SERIAL PRIMARY KEY, + "date_ech" datetime, -- date d'echeance + "date_pai" datetime, -- date de paiements + "libelle" varchar(80), + "fk_type" integer, + "amount" real default 0 NOT NULL, + "paye" smallint default 0 NOT NULL, + "periode" date +); + + + diff --git a/pgsql/tables/llx_co_fa.sql b/pgsql/tables/llx_co_fa.sql index 67b14da60b8..a34d1610c7a 100644 --- a/pgsql/tables/llx_co_fa.sql +++ b/pgsql/tables/llx_co_fa.sql @@ -1,33 +1,35 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_co_fa -( - rowid serial PRIMARY KEY, - fk_commande integer NOT NULL, - fk_facture integer NOT NULL -); - -CREATE INDEX llx_co_fa_fk_commande ON llx_co_fa(fk_commande); - -CREATE INDEX llx_co_fa_fk_facture ON llx_co_fa(fk_facture); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + + +create table llx_co_fa +( + rowid SERIAL PRIMARY KEY, + "fk_commande" integer NOT NULL, + "fk_facture" integer NOT NULL +); + +CREATE INDEX llx_co_fa_fk_commande ON llx_co_fa (fk_commande); +CREATE INDEX llx_co_fa_fk_facture ON llx_co_fa (fk_facture); diff --git a/pgsql/tables/llx_co_pr.sql b/pgsql/tables/llx_co_pr.sql index 73013aba525..c65e1826e6f 100644 --- a/pgsql/tables/llx_co_pr.sql +++ b/pgsql/tables/llx_co_pr.sql @@ -1,29 +1,31 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_co_pr -( - rowid serial PRIMARY KEY, - fk_commande integer, - fk_propale integer -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_co_pr +( + rowid SERIAL PRIMARY KEY, + "fk_commande" integer, + "fk_propale" integer +); diff --git a/pgsql/tables/llx_commande.sql b/pgsql/tables/llx_commande.sql index 4ca6587a1b9..00bbd247cba 100644 --- a/pgsql/tables/llx_commande.sql +++ b/pgsql/tables/llx_commande.sql @@ -1,53 +1,53 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_commande -( - rowid serial PRIMARY KEY, - tms timestamp, - fk_soc integer, - fk_soc_contact integer, - fk_projet integer DEFAULT 0, -- projet auquel est rattache la commande - ref varchar(30) NOT NULL, -- propal number - date_creation timestamp without time zone, -- date de creation - date_valid timestamp without time zone, -- date de validation - date_cloture timestamp without time zone, -- date de cloture - date_commande date, -- date de la commande - fk_user_author integer, -- createur de la commande - fk_user_valid integer, -- valideur de la commande - fk_user_cloture integer, -- cloture de la propale signee ou non signee - source smallint NOT NULL, - fk_statut smallint default 0, - amount_ht real default 0, - remise_percent real default 0, - remise real default 0, - tva real default 0, - total_ht real default 0, - total_ttc real default 0, - note text, - model_pdf varchar(50), - facture smallint default 0, - - UNIQUE (ref) -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_commande +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "fk_soc" integer, + "fk_soc_contact" integer, + "fk_projet" integer DEFAULT 0, -- projet auquel est rattache la commande + "ref" varchar(30) NOT NULL, -- propal number + "date_creation" datetime, -- date de creation + "date_valid" datetime, -- date de validation + "date_cloture" datetime, -- date de cloture + "date_commande" date, -- date de la commande + "fk_user_author" integer, -- createur de la commande + "fk_user_valid" integer, -- valideur de la commande + "fk_user_cloture" integer, -- cloture de la propale signee ou non signee + "source" smallint NOT NULL, + "fk_statut" smallint default 0, + "amount_ht" real default 0, + "remise_percent" real default 0, + "remise" real default 0, + "tva" real default 0, + "total_ht" real default 0, + "total_ttc" real default 0, + "note" text, + "model_pdf" varchar(50), + "facture" tinyint default 0, +4294967294); diff --git a/pgsql/tables/llx_commande_fournisseur.sql b/pgsql/tables/llx_commande_fournisseur.sql new file mode 100644 index 00000000000..06f9e95773b --- /dev/null +++ b/pgsql/tables/llx_commande_fournisseur.sql @@ -0,0 +1,54 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + + +create table llx_commande_fournisseur +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "fk_soc" integer, + "fk_soc_contact" integer, + "fk_projet" integer DEFAULT 0, -- projet auquel est rattache la commande + "ref" varchar(30) NOT NULL, -- propal number + "date_creation" datetime, -- date de creation + "date_valid" datetime, -- date de validation + "date_cloture" datetime, -- date de cloture + "date_commande" date, -- date de la commande + "fk_methode_commande" integer default 0, + "fk_user_author" integer, -- createur de la commande + "fk_user_valid" integer, -- valideur de la commande + "fk_user_cloture" integer, -- cloture de la propale signee ou non signee + "source" smallint NOT NULL, + "fk_statut" smallint default 0, + "amount_ht" real default 0, + "remise_percent" real default 0, + "remise" real default 0, + "tva" real default 0, + "total_ht" real default 0, + "total_ttc" real default 0, + "note" text, + "model_pdf" varchar(50), +4294967294); diff --git a/pgsql/tables/llx_commande_fournisseur_log.sql b/pgsql/tables/llx_commande_fournisseur_log.sql new file mode 100644 index 00000000000..9c22682c86d --- /dev/null +++ b/pgsql/tables/llx_commande_fournisseur_log.sql @@ -0,0 +1,35 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_commande_fournisseur_log +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datelog" datetime, + "fk_commande" integer NOT NULL, + "fk_statut" smallint NOT NULL, + "fk_user" integer NOT NULL +); diff --git a/pgsql/tables/llx_commande_fournisseurdet.sql b/pgsql/tables/llx_commande_fournisseurdet.sql new file mode 100644 index 00000000000..83e5ccae71a --- /dev/null +++ b/pgsql/tables/llx_commande_fournisseurdet.sql @@ -0,0 +1,40 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_commande_fournisseurdet +( + rowid SERIAL PRIMARY KEY, + "fk_commande" integer, + "fk_product" integer, + "ref" varchar(50), + "label" varchar(255), + "description" text, + "tva_tx" real DEFAULT 19.6, -- taux tva + "qty" real, -- quantité + "remise_percent" real DEFAULT 0, -- pourcentage de remise + "remise" real DEFAULT 0, -- montant de la remise + "subprice" real, -- prix avant remise + "price" real -- prix final +); diff --git a/pgsql/tables/llx_commandedet.sql b/pgsql/tables/llx_commandedet.sql index e8dca6f87d8..c1cc42a324d 100644 --- a/pgsql/tables/llx_commandedet.sql +++ b/pgsql/tables/llx_commandedet.sql @@ -1,37 +1,39 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_commandedet -( - rowid serial PRIMARY KEY, - fk_commande integer, - fk_product integer, - label varchar(255), - description text, - tva_tx real DEFAULT 19.6, -- taux tva - qty real, -- quantité - remise_percent real DEFAULT 0, -- pourcentage de remise - remise real DEFAULT 0, -- montant de la remise - subprice real, -- prix avant remise - price real -- prix final -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_commandedet +( + rowid SERIAL PRIMARY KEY, + "fk_commande" integer, + "fk_product" integer, + "label" varchar(255), + "description" text, + "tva_tx" real DEFAULT 19.6, -- taux tva + "qty" real, -- quantité + "remise_percent" real DEFAULT 0, -- pourcentage de remise + "remise" real DEFAULT 0, -- montant de la remise + "subprice" real, -- prix avant remise + "price" real -- prix final +); diff --git a/pgsql/tables/llx_compta.sql b/pgsql/tables/llx_compta.sql index def3fb08361..f9aefbda8c2 100644 --- a/pgsql/tables/llx_compta.sql +++ b/pgsql/tables/llx_compta.sql @@ -1,39 +1,40 @@ --- =================================================================== --- Copyright (C) 2000-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - - -create table llx_compta -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - datev date, -- date de valeur - amount real DEFAULT 0 NOT NULL, - label varchar(255), - fk_compta_account integer, - fk_user_author integer, - fk_user_valid integer, - valid int default 0, - note text - -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2000-2002 Rodolphe Quiedeville +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + + +create table llx_compta +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "datev" date, -- date de valeur + "amount" real DEFAULT 0 NOT NULL , + "label" varchar(255), + "fk_compta_account" integer, + "fk_user_author" integer, + "fk_user_valid" integer, + "valid" tinyint DEFAULT 0, + "note" text +); diff --git a/pgsql/tables/llx_compta_account.sql b/pgsql/tables/llx_compta_account.sql index 0e20a17a62c..b20cb47bc01 100644 --- a/pgsql/tables/llx_compta_account.sql +++ b/pgsql/tables/llx_compta_account.sql @@ -1,35 +1,36 @@ --- =================================================================== --- Copyright (C) 2000-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - - -create table llx_compta_account -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - number varchar(12), - label varchar(255), - fk_user_author integer, - note text - -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2000-2002 Rodolphe Quiedeville +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + + +create table llx_compta_account +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "number" varchar(12), + "label" varchar(255), + "fk_user_author" integer, + "note" text +); diff --git a/pgsql/tables/llx_compta_compte_generaux.sql b/pgsql/tables/llx_compta_compte_generaux.sql new file mode 100644 index 00000000000..e20914bbf92 --- /dev/null +++ b/pgsql/tables/llx_compta_compte_generaux.sql @@ -0,0 +1,36 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + + +create table llx_compta_compte_generaux +( + rowid SERIAL PRIMARY KEY, + "date_creation" datetime, + "numero" varchar(50), + "intitule" varchar(255), + "fk_user_author" integer, + "note" text +); diff --git a/pgsql/tables/llx_concert.sql b/pgsql/tables/llx_concert.sql index c9b8adefb74..c77105b9d98 100644 --- a/pgsql/tables/llx_concert.sql +++ b/pgsql/tables/llx_concert.sql @@ -1,35 +1,38 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_concert -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - date_concert timestamp without time zone NOT NULL, - description text, - collectif smallint DEFAULT 0 NOT NULL, - fk_groupart integer, - fk_lieu_concert integer, - fk_user_author integer -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_concert +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "date_concert" datetime, + "description" text, + "collectif" tinyint DEFAULT 0 NOT NULL, + "fk_groupart" integer, + "fk_lieu_concert" integer, + "fk_user_author" integer +); + diff --git a/pgsql/tables/llx_cond_reglement.sql b/pgsql/tables/llx_cond_reglement.sql index ecafd0a2077..69cf7a0e98b 100644 --- a/pgsql/tables/llx_cond_reglement.sql +++ b/pgsql/tables/llx_cond_reglement.sql @@ -1,33 +1,37 @@ --- ============================================================================ --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_cond_reglement -( - rowid SERIAL PRIMARY KEY, - sortorder smallint, - actif smallint DEFAULT 1, - libelle varchar(255), - libelle_facture text, - fdm smallint, -- reglement fin de mois - nbjour smallint -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_cond_reglement +( + rowid integer PRIMARY KEY, + "code" varchar(16), + "sortorder" smallint, + "actif" tinyint DEFAULT 1, + "libelle" varchar(255), + "libelle_facture" text, + "fdm" tinyint, -- reglement fin de mois + "nbjour" smallint +); diff --git a/pgsql/tables/llx_const.sql b/pgsql/tables/llx_const.sql index 3524fb1817e..3c44552ec8f 100644 --- a/pgsql/tables/llx_const.sql +++ b/pgsql/tables/llx_const.sql @@ -1,38 +1,40 @@ --- ============================================================================ --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2003 Jean-Louis Bergamo --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== --- --- Definitions des constantes utilisés comme parametres de configuration --- - -create table llx_const -( - rowid SERIAL PRIMARY KEY, - name varchar(255), - value text, -- max 65535 caracteres - type CHAR(6) CHECK (type IN ('yesno','texte','chaine')), - visible smallint DEFAULT 1 NOT NULL, - note text -); - -CREATE UNIQUE INDEX llx_const_idx ON llx_const (name); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- Copyright (C) 2003 Jean-Louis Bergamo +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== +-- +-- Definitions des constantes utilisés comme parametres de configuration +-- + + +create table llx_const +( + rowid SERIAL PRIMARY KEY, + "name" varchar(255), + "value" text, -- max 65535 caracteres + "type" varchar(6) CHECK (type IN ('yesno','texte','chaine')) , + "visible" tinyint DEFAULT 1 NOT NULL, + "note" text +); diff --git a/pgsql/tables/llx_contact_facture.sql b/pgsql/tables/llx_contact_facture.sql index 324ca554673..33d370a0f0a 100644 --- a/pgsql/tables/llx_contact_facture.sql +++ b/pgsql/tables/llx_contact_facture.sql @@ -1,33 +1,35 @@ --- ============================================================================ --- Copyright (C) 2001-2004 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- Contact pour la facturation client --- --- ============================================================================ - -create table llx_contact_facture -( - idp serial PRIMARY KEY, - fk_soc integer NOT NULL, - fk_contact integer NOT NULL, -- point sur llx_socpeople - - UNIQUE (fk_soc, fk_contact) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- Contact pour la facturation client +-- +-- ============================================================================ + + +create table llx_contact_facture +( + idp SERIAL PRIMARY KEY, + "fk_soc" integer NOT NULL, + "fk_contact" integer NOT NULL, -- point sur llx_socpeople +); diff --git a/pgsql/tables/llx_contrat.key.sql b/pgsql/tables/llx_contrat.key.sql new file mode 100644 index 00000000000..f0fb7a94457 --- /dev/null +++ b/pgsql/tables/llx_contrat.key.sql @@ -0,0 +1,39 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2002-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +-- +-- +ALTER TABLE llx_contrat ADD INDEX (fk_soc); +ALTER TABLE llx_contrat ADD INDEX (fk_commercial_signature); +ALTER TABLE llx_contrat ADD INDEX (fk_commercial_suivi); +ALTER TABLE llx_contrat ADD INDEX (fk_user_author); +-- +-- +ALTER TABLE llx_contrat ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); +ALTER TABLE llx_contrat ADD FOREIGN KEY (fk_commercial_signature) REFERENCES llx_user (rowid); +ALTER TABLE llx_contrat ADD FOREIGN KEY (fk_commercial_suivi) REFERENCES llx_user (rowid); +ALTER TABLE llx_contrat ADD FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); diff --git a/pgsql/tables/llx_contrat.sql b/pgsql/tables/llx_contrat.sql index 2fa873c707b..a46fd148595 100644 --- a/pgsql/tables/llx_contrat.sql +++ b/pgsql/tables/llx_contrat.sql @@ -1,40 +1,47 @@ --- ============================================================================ --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_contrat -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - enservice smallint DEFAULT 0, - mise_en_service timestamp without time zone, - fin_validite timestamp without time zone, - date_cloture timestamp without time zone, - fk_soc integer NOT NULL, - fk_product integer NOT NULL, - fk_facture integer NOT NULL DEFAULT 0, - fk_facturedet integer NOT NULL DEFAULT 0, - fk_user_author integer NOT NULL, - fk_user_mise_en_service integer, - fk_user_cloture integer -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2002-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + + +create table llx_contrat +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datec" datetime, -- date de creation de l'enregistrement + "date_contrat" datetime, + "statut" smallint DEFAULT 0, + "mise_en_service" datetime, + "fin_validite" datetime, + "date_cloture" datetime, + "fk_soc" integer NOT NULL, + "fk_commercial_signature" integer NOT NULL, + "fk_commercial_suivi" integer NOT NULL, + "fk_user_author" integer NOT NULL default 0, + "fk_user_mise_en_service" integer, + "fk_user_cloture" integer +); + diff --git a/pgsql/tables/llx_contratdet.key.sql b/pgsql/tables/llx_contratdet.key.sql new file mode 100644 index 00000000000..4cbc38b5fd4 --- /dev/null +++ b/pgsql/tables/llx_contratdet.key.sql @@ -0,0 +1,33 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ +-- +-- +ALTER TABLE llx_contratdet ADD INDEX (fk_contrat); +ALTER TABLE llx_contratdet ADD INDEX (fk_product); +-- +-- +ALTER TABLE llx_contratdet ADD FOREIGN KEY (fk_contrat) REFERENCES llx_contrat (rowid); +ALTER TABLE llx_contratdet ADD FOREIGN KEY (fk_product) REFERENCES llx_product (rowid); diff --git a/pgsql/tables/llx_contratdet.sql b/pgsql/tables/llx_contratdet.sql new file mode 100644 index 00000000000..6533589fc35 --- /dev/null +++ b/pgsql/tables/llx_contratdet.sql @@ -0,0 +1,58 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + + + + + + + +create table llx_contratdet +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "fk_contrat" integer NOT NULL, + "fk_product" integer NOT NULL, + "statut" smallint DEFAULT 0, + "label" text, -- libellé du produit + "description" text, + "date_commande" datetime, + "date_ouverture_prevue" datetime, + "date_ouverture" datetime, -- date d'ouverture du service chez le client + "date_fin_validite" datetime, + "date_cloture" datetime, + "tva_tx" real DEFAULT 19.6, -- taux tva + "qty" real, -- quantité + "remise_percent" real DEFAULT 0, -- pourcentage de remise + "remise" real DEFAULT 0, -- montant de la remise + "subprice" real, -- prix avant remise + "price_ht" real, -- prix final + "fk_user_author" integer NOT NULL default 0, + "fk_user_ouverture" integer, + "fk_user_cloture" integer, + "commentaire" text +); diff --git a/pgsql/tables/llx_contratdet_log.sql b/pgsql/tables/llx_contratdet_log.sql new file mode 100644 index 00000000000..f0de7c4297a --- /dev/null +++ b/pgsql/tables/llx_contratdet_log.sql @@ -0,0 +1,37 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_contratdet_log +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "fk_contratdet" integer NOT NULL, + "date" datetime, + "statut" smallint NOT NULL, + "fk_user_author" integer NOT NULL, + "commentaire" text +); diff --git a/pgsql/tables/llx_cotisation.sql b/pgsql/tables/llx_cotisation.sql index 09d28158e3d..129f5737712 100644 --- a/pgsql/tables/llx_cotisation.sql +++ b/pgsql/tables/llx_cotisation.sql @@ -1,34 +1,36 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - - -create table llx_cotisation -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - datec timestamp without time zone, - fk_adherent integer, - dateadh timestamp without time zone, - cotisation real, - fk_bank integer DEFAULT NULL, - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_cotisation +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datec" datetime, + "fk_adherent" integer, + "dateadh" datetime, + "cotisation" real, + "fk_bank" int4 DEFAULT NULL, + "note" text +); diff --git a/pgsql/tables/llx_deplacement.sql b/pgsql/tables/llx_deplacement.sql index 1a9027538b0..e5ded27313c 100644 --- a/pgsql/tables/llx_deplacement.sql +++ b/pgsql/tables/llx_deplacement.sql @@ -1,36 +1,39 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_deplacement -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone NOT NULL, - tms timestamp, - dated timestamp without time zone, - fk_user integer NOT NULL, - fk_user_author integer, - type smallint NOT NULL, - km smallint, - fk_soc integer, - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_deplacement +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "dated" datetime, + "fk_user" integer NOT NULL, + "fk_user_author" integer, + "type" smallint NOT NULL, + "km" smallint, + "fk_soc" integer, + "note" text +); diff --git a/pgsql/tables/llx_domain.sql b/pgsql/tables/llx_domain.sql index 8533dc9aa5d..1d551c9f4ca 100644 --- a/pgsql/tables/llx_domain.sql +++ b/pgsql/tables/llx_domain.sql @@ -1,32 +1,34 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_domain -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - label varchar(255), - note text -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_domain +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "label" varchar(255), + "note" text +); + diff --git a/pgsql/tables/llx_don.sql b/pgsql/tables/llx_don.sql index ce7b6051fb3..d69cac3585e 100644 --- a/pgsql/tables/llx_don.sql +++ b/pgsql/tables/llx_don.sql @@ -1,46 +1,49 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - - -create table llx_don -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - fk_statut smallint NOT NULL DEFAULT 0,-- etat du don promesse/valid - datec timestamp without time zone, -- date de création de l'enregistrement - datedon timestamp without time zone, -- date du don/promesse - amount real DEFAULT 0, - fk_paiement integer, - prenom varchar(50), - nom varchar(50), - societe varchar(50), - adresse text, - cp varchar(30), - ville varchar(50), - pays varchar(50), - email varchar(255), - public smallint DEFAULT 1 NOT NULL, -- le don est-il public (0,1) - fk_don_projet integer NOT NULL, -- projet auquel est fait le don - fk_user_author integer NOT NULL, - fk_user_valid integer NOT NULL, - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_don +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "fk_statut" smallint NOT NULL DEFAULT 0,-- etat du don promesse/valid + "datec" datetime, -- date de création de l'enregistrement + "datedon" datetime, -- date du don/promesse + "amount" real DEFAULT 0, + "fk_paiement" integer, + "prenom" varchar(50), + "nom" varchar(50), + "societe" varchar(50), + "adresse" text, + "cp" varchar(30), + "ville" varchar(50), + "pays" varchar(50), + "email" varchar(255), + "public" smallint DEFAULT 1 NOT NULL, -- le don est-il public (0,1) + "fk_don_projet" integer NOT NULL, -- projet auquel est fait le don + "fk_user_author" integer NOT NULL, + "fk_user_valid" integer NOT NULL, + "note" text +); diff --git a/pgsql/tables/llx_don_projet.sql b/pgsql/tables/llx_don_projet.sql index ad0a9995ade..db55bafbcee 100644 --- a/pgsql/tables/llx_don_projet.sql +++ b/pgsql/tables/llx_don_projet.sql @@ -1,32 +1,35 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - - -create table llx_don_projet -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - datec timestamp without time zone, - libelle varchar(255), - fk_user_author integer NOT NULL, - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_don_projet +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datec" datetime, + "libelle" varchar(255), + "fk_user_author" integer NOT NULL, + "note" text +); diff --git a/pgsql/tables/llx_editeur.sql b/pgsql/tables/llx_editeur.sql index b2e4212f46c..22968e86f7c 100644 --- a/pgsql/tables/llx_editeur.sql +++ b/pgsql/tables/llx_editeur.sql @@ -1,32 +1,35 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_editeur -( - rowid SERIAL PRIMARY KEY, - oscid integer NOT NULL, - tms timestamp, - nom varchar(255), - fk_user_author integer -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_editeur +( + rowid SERIAL PRIMARY KEY, + "oscid" integer NOT NULL, + "tms" timestamp, + "nom" varchar(255), + "fk_user_author" integer +); + diff --git a/pgsql/tables/llx_entrepot.sql b/pgsql/tables/llx_entrepot.sql index eca33a44b3d..68d3a4e77c2 100644 --- a/pgsql/tables/llx_entrepot.sql +++ b/pgsql/tables/llx_entrepot.sql @@ -1,34 +1,38 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_entrepot -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - label varchar(255) NOT NULL, - description text, - statut smallint DEFAULT 1, -- 1 ouvert, 0 fermé - fk_user_author integer -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_entrepot +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "label" varchar(255) NOT NULL, + "description" text, + "statut" tinyint DEFAULT 1, -- 1 ouvert, 0 fermé + "fk_user_author" integer +); + diff --git a/pgsql/tables/llx_expedition.sql b/pgsql/tables/llx_expedition.sql index 2402e67f228..e893066a0c1 100644 --- a/pgsql/tables/llx_expedition.sql +++ b/pgsql/tables/llx_expedition.sql @@ -1,46 +1,47 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_expedition -( - rowid serial PRIMARY KEY, - tms timestamp, - ref varchar(30) NOT NULL, - fk_commande integer, - date_creation timestamp without time zone, -- date de creation - date_valid timestamp without time zone, -- date de validation - date_expedition date, -- date de l'expedition - fk_user_author integer, -- createur - fk_user_valid integer, -- valideur - fk_entrepot integer, - fk_expedition_methode integer, - fk_statut smallint DEFAULT 0, - note text, - model_pdf varchar(50), - - UNIQUE (ref) -); - -CREATE INDEX llx_expedition_fk_expedition_methode ON llx_expedition(fk_expedition_methode); - -CREATE INDEX llx_expedition_fk_commande ON llx_expedition(fk_commande); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + + +create table llx_expedition +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "ref" varchar(30) NOT NULL, + "fk_commande" integer, + "date_creation" datetime, -- date de creation + "date_valid" datetime, -- date de validation + "date_expedition" date, -- date de l'expedition + "fk_user_author" integer, -- createur + "fk_user_valid" integer, -- valideur + "fk_entrepot" integer, + "fk_expedition_methode" integer, + "fk_statut" smallint DEFAULT 0, + "note" text, + "model_pdf" varchar(50), +4294967294); + +CREATE INDEX llx_expedition_fk_expedition_methode ON llx_expedition (fk_expedition_methode); +CREATE INDEX llx_expedition_fk_commande ON llx_expedition (fk_commande); diff --git a/pgsql/tables/llx_expedition_methode.sql b/pgsql/tables/llx_expedition_methode.sql index e65df216a90..ad531c64717 100644 --- a/pgsql/tables/llx_expedition_methode.sql +++ b/pgsql/tables/llx_expedition_methode.sql @@ -1,32 +1,35 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_expedition_methode -( - rowid integer PRIMARY KEY, - tms timestamp, - code varchar(30) NOT NULL, - libelle varchar(50) NOT NULL, - description text, - statut smallint DEFAULT 0 -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_expedition_methode +( + rowid integer PRIMARY KEY, + "tms" timestamp, + "code" varchar(30) NOT NULL, + "libelle" varchar(50) NOT NULL, + "description" text, + "statut" tinyint DEFAULT 0 +); diff --git a/pgsql/tables/llx_expeditiondet.sql b/pgsql/tables/llx_expeditiondet.sql index 5979d64db5b..6a9b6096a02 100644 --- a/pgsql/tables/llx_expeditiondet.sql +++ b/pgsql/tables/llx_expeditiondet.sql @@ -1,34 +1,36 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_expeditiondet -( - rowid serial PRIMARY KEY, - fk_expedition integer NOT NULL, - fk_commande_ligne integer NOT NULL, - qty real -- quantité -); - -CREATE INDEX llx_expeditiondet_fk_expedition ON llx_expeditiondet(fk_expedition); - -CREATE INDEX llx_expeditiondet_fk_commande_ligne ON llx_expeditiondet(fk_commande_ligne); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + + +create table llx_expeditiondet +( + rowid SERIAL PRIMARY KEY, + "fk_expedition" integer NOT NULL, + "fk_commande_ligne" integer NOT NULL, + "qty" real, -- quantité +); + +CREATE INDEX llx_expeditiondet_fk_expedition ON llx_expeditiondet (fk_expedition); +CREATE INDEX llx_expeditiondet_fk_commande_ligne ON llx_expeditiondet (fk_commande_ligne); diff --git a/pgsql/tables/llx_export_compta.sql b/pgsql/tables/llx_export_compta.sql new file mode 100644 index 00000000000..f2d2c538b81 --- /dev/null +++ b/pgsql/tables/llx_export_compta.sql @@ -0,0 +1,36 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== +-- +-- $Revision$ + + +create table llx_export_compta +( + rowid SERIAL PRIMARY KEY, + "ref" varchar(12) NOT NULL, + "date_export" datetime, -- date de creation + "fk_user" integer NOT NULL, + "note" text +); diff --git a/pgsql/tables/llx_fa_pr.sql b/pgsql/tables/llx_fa_pr.sql index 43bd08b517f..459c942a970 100644 --- a/pgsql/tables/llx_fa_pr.sql +++ b/pgsql/tables/llx_fa_pr.sql @@ -1,28 +1,31 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_fa_pr -( - rowid SERIAL PRIMARY KEY, - fk_facture integer, - fk_propal integer -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_fa_pr +( + rowid SERIAL PRIMARY KEY, + "fk_facture" integer, + "fk_propal" integer +); diff --git a/pgsql/tables/llx_facture.key.sql b/pgsql/tables/llx_facture.key.sql new file mode 100644 index 00000000000..ecbfc01da61 --- /dev/null +++ b/pgsql/tables/llx_facture.key.sql @@ -0,0 +1,36 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2002-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +ALTER TABLE llx_facture ADD INDEX (fk_soc); + +ALTER TABLE llx_facture ADD INDEX (fk_user_author); +ALTER TABLE llx_facture ADD INDEX (fk_user_valid); + +ALTER TABLE llx_facture ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); + +ALTER TABLE llx_facture ADD FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); +ALTER TABLE llx_facture ADD FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); diff --git a/pgsql/tables/llx_facture.sql b/pgsql/tables/llx_facture.sql index 7c3aa0e21b4..22b87273cfe 100644 --- a/pgsql/tables/llx_facture.sql +++ b/pgsql/tables/llx_facture.sql @@ -1,52 +1,53 @@ --- =========================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_facture -( - rowid SERIAL PRIMARY KEY, - facnumber varchar(50) NOT NULL, - fk_soc integer NOT NULL, - datec timestamp without time zone, -- date de creation de la facture - datef date, -- date de la facture - paye smallint DEFAULT 0 NOT NULL, - amount real DEFAULT 0 NOT NULL, - remise real DEFAULT 0, - remise_percent real DEFAULT 0, - tva real DEFAULT 0, - total real DEFAULT 0, - total_ttc real DEFAULT 0, - fk_statut smallint DEFAULT 0 NOT NULL, - author varchar(50), - fk_user integer, -- createur de la facture - fk_user_author integer, -- createur de la propale - fk_user_valid integer, -- valideur de la propale - fk_projet integer, -- projet auquel est associé la facture - fk_cond_reglement integer, -- condition de reglement - date_lim_reglement date, -- date limite de reglement - note text -); - -create unique index llx_facture_facnumber on llx_facture(facnumber); - -create index llx_facture_fksoc on llx_facture(fk_soc); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =========================================================================== +-- Copyright (C) 2001-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =========================================================================== + + +create table llx_facture +( + rowid SERIAL PRIMARY KEY, + "facnumber" varchar(50) NOT NULL, + "increment" varchar(10), + "fk_soc" integer NOT NULL, + "datec" datetime, -- date de creation de la facture + "datef" date, -- date de la facture + "paye" smallint DEFAULT 0 NOT NULL, + "amount" real DEFAULT 0 NOT NULL, + "remise" real DEFAULT 0, + "remise_percent" real DEFAULT 0, + "tva" real DEFAULT 0, + "total" real DEFAULT 0, + "total_ttc" real DEFAULT 0, + "fk_statut" smallint DEFAULT 0 NOT NULL, + "author" varchar(50), + "fk_user" integer, -- createur de la facture + "fk_user_author" integer, -- createur de la propale + "fk_user_valid" integer, -- valideur de la propale + "fk_projet" integer, -- projet auquel est associé la facture + "fk_cond_reglement" integer, -- condition de reglement (30 jours, fin de mois ...) + "fk_mode_reglement" integer, -- mode de reglement (Virement, Prélèvement) + "date_lim_reglement" date, -- date limite de reglement + "note" text, +4294967294 "INDEX" fksoc (fk_soc) +); diff --git a/pgsql/tables/llx_facture_fourn.sql b/pgsql/tables/llx_facture_fourn.sql index 00e470cea88..02329d30c34 100644 --- a/pgsql/tables/llx_facture_fourn.sql +++ b/pgsql/tables/llx_facture_fourn.sql @@ -1,49 +1,51 @@ --- =========================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_facture_fourn -( - rowid SERIAL PRIMARY KEY, - facnumber varchar(50) NOT NULL, - fk_soc integer NOT NULL, - datec timestamp without time zone, -- date de creation de la facture - datef date, -- date de la facture - libelle varchar(255), - paye smallint DEFAULT 0 NOT NULL, - amount real DEFAULT 0 NOT NULL, - remise real DEFAULT 0, - tva real DEFAULT 0, - total real DEFAULT 0, - total_ht real DEFAULT 0, - total_tva real DEFAULT 0, - total_ttc real DEFAULT 0, - - fk_statut smallint DEFAULT 0 NOT NULL, - - fk_user_author integer, -- createur de la propale - fk_user_valid integer, -- valideur de la propale - note text -); - -create unique index llx_facture_fourn_facnumber on llx_facture_fourn(facnumber, fk_soc); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =========================================================================== +-- Copyright (C) 2001-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + + + + +create table llx_facture_fourn +( + rowid SERIAL PRIMARY KEY, + "facnumber" varchar(50) NOT NULL, + "fk_soc" integer NOT NULL, + "datec" datetime, -- date de creation de la facture + "datef" date, -- date de la facture + "libelle" varchar(255), + "paye" smallint DEFAULT 0 NOT NULL, + "amount" real DEFAULT 0 NOT NULL, + "remise" real DEFAULT 0, + "tva" real DEFAULT 0, + "total" real DEFAULT 0, + "total_ht" real DEFAULT 0, + "total_tva" real DEFAULT 0, + "total_ttc" real DEFAULT 0, + "fk_statut" smallint DEFAULT 0 NOT NULL, + "fk_user_author" integer, -- createur de la facture + "fk_user_valid" integer, -- valideur de la facture + "note" text +); diff --git a/pgsql/tables/llx_facture_fourn_det.sql b/pgsql/tables/llx_facture_fourn_det.sql index 2ebb68bdbdb..077b5d82609 100644 --- a/pgsql/tables/llx_facture_fourn_det.sql +++ b/pgsql/tables/llx_facture_fourn_det.sql @@ -1,36 +1,39 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_facture_fourn_det -( - rowid SERIAL PRIMARY KEY, - fk_facture_fourn integer NOT NULL, - fk_product integer NULL, - description text, - pu_ht real DEFAULT 0, - qty smallint DEFAULT 1, - total_ht real DEFAULT 0, - tva_taux real DEFAULT 0, - tva real DEFAULT 0, - total_ttc real DEFAULT 0 -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + + +create table llx_facture_fourn_det +( + rowid SERIAL PRIMARY KEY, + "fk_facture_fourn" integer NOT NULL, + "fk_product" integer NULL, + "description" text, + "pu_ht" real DEFAULT 0, + "qty" smallint DEFAULT 1, + "total_ht" real DEFAULT 0, + "tva_taux" real DEFAULT 0, + "tva" real DEFAULT 0, + "total_ttc" real DEFAULT 0 +); diff --git a/pgsql/tables/llx_facture_rec.sql b/pgsql/tables/llx_facture_rec.sql index e19a93a352f..35d29040cd6 100644 --- a/pgsql/tables/llx_facture_rec.sql +++ b/pgsql/tables/llx_facture_rec.sql @@ -1,45 +1,47 @@ --- =========================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_facture_rec -( - rowid SERIAL PRIMARY KEY, - titre varchar(50) NOT NULL, - fk_soc integer NOT NULL, - datec timestamp without time zone, -- date de creation - - amount real DEFAULT 0 NOT NULL, - remise real DEFAULT 0, - remise_percent real DEFAULT 0, - tva real DEFAULT 0, - total real DEFAULT 0, - total_ttc real DEFAULT 0, - - fk_user_author integer, -- createur - fk_projet integer, -- projet auquel est associé la facture - fk_cond_reglement integer, -- condition de reglement - - note text -); - -CREATE INDEX llx_facture_rec_fksoc ON llx_facture_rec (fk_soc); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =========================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =========================================================================== + + + + + +create table llx_facture_rec +( + rowid SERIAL PRIMARY KEY, + "titre" varchar(50) NOT NULL, + "fk_soc" integer NOT NULL, + "datec" datetime, -- date de creation + "amount" real DEFAULT 0 NOT NULL, + "remise" real DEFAULT 0, + "remise_percent" real DEFAULT 0, + "tva" real DEFAULT 0, + "total" real DEFAULT 0, + "total_ttc" real DEFAULT 0, + "fk_user_author" integer, -- createur + "fk_projet" integer, -- projet auquel est associé la facture + "fk_cond_reglement" integer, -- condition de reglement + "note" text, + "INDEX" fksoc (fk_soc) +); diff --git a/pgsql/tables/llx_facture_tva_sum.key.sql b/pgsql/tables/llx_facture_tva_sum.key.sql new file mode 100644 index 00000000000..cdf5978adcb --- /dev/null +++ b/pgsql/tables/llx_facture_tva_sum.key.sql @@ -0,0 +1,29 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +-- Supprimme orhpelins pour permettre montée de la clé +DELETE llx_facture_tva_sum FROM llx_facture_tva_sum LEFT JOIN llx_facture ON llx_facture_tva_sum.fk_facture = llx_facture.rowid WHERE llx_facture.rowid IS NULL; + +ALTER TABLE llx_facture_tva_sum ADD CONSTRAINT facture_tva_sum_fk_facture_rowid FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid); diff --git a/pgsql/tables/llx_facture_tva_sum.sql b/pgsql/tables/llx_facture_tva_sum.sql index 0cda22c94fc..5e4daadf804 100644 --- a/pgsql/tables/llx_facture_tva_sum.sql +++ b/pgsql/tables/llx_facture_tva_sum.sql @@ -1,31 +1,33 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_facture_tva_sum -( - fk_facture integer NOT NULL, - amount real NOT NULL, - tva_tx real NOT NULL -); - -CREATE INDEX llx_facture_tva_sum_fk_facture ON llx_facture_tva_sum (fk_facture); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + + +create table llx_facture_tva_sum +( + "fk_facture" integer NOT NULL, + "amount" real NOT NULL, + "tva_tx" real NOT NULL, + KEY(fk_facture) +); diff --git a/pgsql/tables/llx_facturedet.key.sql b/pgsql/tables/llx_facturedet.key.sql new file mode 100644 index 00000000000..96094441997 --- /dev/null +++ b/pgsql/tables/llx_facturedet.key.sql @@ -0,0 +1,29 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +-- Supprimme orhpelins pour permettre montée de la clé +DELETE llx_facturedet FROM llx_facturedet LEFT JOIN llx_facture ON llx_facturedet.fk_facture = llx_facture.rowid WHERE llx_facture.rowid IS NULL; + +ALTER TABLE llx_facturedet ADD CONSTRAINT facturedet_fk_facture_rowid FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid); diff --git a/pgsql/tables/llx_facturedet.sql b/pgsql/tables/llx_facturedet.sql index fc612361fe9..190642374bb 100644 --- a/pgsql/tables/llx_facturedet.sql +++ b/pgsql/tables/llx_facturedet.sql @@ -1,41 +1,44 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_facturedet -( - rowid SERIAL PRIMARY KEY, - fk_facture integer NOT NULL, - fk_product integer DEFAULT 0 NOT NULL, - description text, - tva_taux real DEFAULT 19.6, -- taux tva - qty real, -- quantité - remise_percent real DEFAULT 0, -- pourcentage de remise - remise real DEFAULT 0, -- montant de la remise - subprice real, -- prix avant remise - price real, -- prix final - date_start timestamp without time zone, -- date debut si service - date_end timestamp without time zone -- date fin si service -); - -CREATE INDEX llx_facturedet_fk_facture ON llx_facturedet (fk_facture); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2003 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + + +create table llx_facturedet +( + rowid SERIAL PRIMARY KEY, + "fk_facture" integer NOT NULL, + "fk_product" integer DEFAULT 0 NOT NULL, + "description" text, + "tva_taux" real DEFAULT 19.6, -- taux tva + "qty" real, -- quantité + "remise_percent" real DEFAULT 0, -- pourcentage de remise + "remise" real DEFAULT 0, -- montant de la remise + "subprice" real, -- prix avant remise + "price" real, -- prix final + "date_start" datetime, -- date debut si service + "date_end" datetime, -- date fin si service + "fk_code_ventilation" integer DEFAULT 0 NOT NULL, + "fk_export_compta" integer DEFAULT 0 NOT NULL +); diff --git a/pgsql/tables/llx_facturedet_rec.sql b/pgsql/tables/llx_facturedet_rec.sql index ec7943e8745..33fa46eb65e 100644 --- a/pgsql/tables/llx_facturedet_rec.sql +++ b/pgsql/tables/llx_facturedet_rec.sql @@ -1,36 +1,38 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_facturedet_rec -( - rowid SERIAL PRIMARY KEY, - fk_facture integer NOT NULL, - fk_product integer, - description text, - tva_taux real DEFAULT 19.6, -- taux tva - qty real, -- quantité - remise_percent real DEFAULT 0, -- pourcentage de remise - remise real DEFAULT 0, -- montant de la remise - subprice real, -- prix avant remise - price real -- prix final -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_facturedet_rec +( + rowid SERIAL PRIMARY KEY, + "fk_facture" integer NOT NULL, + "fk_product" integer, + "description" text, + "tva_taux" real DEFAULT 19.6, -- taux tva + "qty" real, -- quantité + "remise_percent" real DEFAULT 0, -- pourcentage de remise + "remise" real DEFAULT 0, -- montant de la remise + "subprice" real, -- prix avant remise + "price" real -- prix final +); diff --git a/pgsql/tables/llx_fichinter.key.sql b/pgsql/tables/llx_fichinter.key.sql new file mode 100644 index 00000000000..2d876ace9d3 --- /dev/null +++ b/pgsql/tables/llx_fichinter.key.sql @@ -0,0 +1,27 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +ALTER TABLE llx_fichinter ADD CONSTRAINT fichinter_fk_soc_idp FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); diff --git a/pgsql/tables/llx_fichinter.sql b/pgsql/tables/llx_fichinter.sql index 3d85d13b792..ae800062d9f 100644 --- a/pgsql/tables/llx_fichinter.sql +++ b/pgsql/tables/llx_fichinter.sql @@ -1,42 +1,42 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_fichinter -( - rowid SERIAL PRIMARY KEY, - fk_soc integer NOT NULL, - fk_projet integer DEFAULT 0, -- projet auquel est rattache la fiche - ref varchar(30) NOT NULL, -- number - datec timestamp without time zone, -- date de creation - date_valid timestamp without time zone, -- date de validation - datei date, -- date de l'intervention - fk_user_author integer, -- createur de la fiche - fk_user_valid integer, -- valideur de la fiche - fk_statut smallint DEFAULT 0, - duree real, - note text -); - -CREATE UNIQUE INDEX llx_fichinter_ref ON llx_fichinter(ref); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + + +create table llx_fichinter +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer NOT NULL, + "fk_projet" integer DEFAULT 0, -- projet auquel est rattache la fiche + "ref" varchar(30) NOT NULL, -- number + "datec" datetime, -- date de creation + "date_valid" datetime, -- date de validation + "datei" date, -- date de l'intervention + "fk_user_author" integer, -- createur de la fiche + "fk_user_valid" integer, -- valideur de la fiche + "fk_statut" smallint DEFAULT 0, + "duree" real, + "note" text, +4294967294); diff --git a/pgsql/tables/llx_groupart.sql b/pgsql/tables/llx_groupart.sql index 28d5009e8fc..34e3f0f26d2 100644 --- a/pgsql/tables/llx_groupart.sql +++ b/pgsql/tables/llx_groupart.sql @@ -1,34 +1,37 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_groupart -( - rowid SERIAL PRIMARY KEY, - osc_id integer NOT NULL, - tms timestamp, - nom varchar(64), - groupart CHAR(8) CHECK (groupart IN ('artiste','groupe')) NOT NULL, - description text NOT NULL, - fk_user_author integer -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_groupart +( + rowid SERIAL PRIMARY KEY, + "osc_id" integer NOT NULL, + "tms" timestamp, + "nom" varchar(64), + "groupart" varchar(7) CHECK (groupart IN ("artiste","groupe")) NOT NULL, + "description" text NOT NULL, + "fk_user_author" integer +); + diff --git a/pgsql/tables/llx_groupesociete.sql b/pgsql/tables/llx_groupesociete.sql index 124a4befffe..4d740a4494d 100644 --- a/pgsql/tables/llx_groupesociete.sql +++ b/pgsql/tables/llx_groupesociete.sql @@ -1,36 +1,38 @@ --- ======================================================================== --- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2000-2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_groupesociete -( - rowid serial PRIMARY KEY, - parent integer UNIQUE, - tms timestamp, - datec timestamp without time zone, -- creation date - nom varchar(60), -- company name - note text, -- - remise real DEFAULT 0, -- remise systématique pour le client - fk_user_author integer - -) - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2000-2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + + +create table llx_groupesociete +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datec" datetime, -- creation date + "nom" varchar(60), -- company name + "note" text, -- + "remise" real DEFAULT 0, -- remise systématique pour le client + "fk_user_author" integer +); + diff --git a/pgsql/tables/llx_groupesociete_remise.sql b/pgsql/tables/llx_groupesociete_remise.sql index 3be10274c27..8cc1dfacd87 100644 --- a/pgsql/tables/llx_groupesociete_remise.sql +++ b/pgsql/tables/llx_groupesociete_remise.sql @@ -1,37 +1,40 @@ --- ======================================================================== --- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2000-2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- Historique des remises au groupes de societes --- --- ======================================================================== - -create table llx_groupesociete_remise -( - rowid serial PRIMARY KEY, - fk_groupe integer NOT NULL, - tms timestamp, - datec timestamp without time zone, -- creation date - fk_user_author integer, -- utilisateur qui a créé l'info - remise real DEFAULT 0, -- remise systématique pour le client - note text - -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2000-2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- Historique des remises au groupes de societes +-- +-- ======================================================================== + + +create table llx_groupesociete_remise +( + rowid SERIAL PRIMARY KEY, + "fk_groupe" integer NOT NULL, + "tms" timestamp, + "datec" datetime, -- creation date + "fk_user_author" integer, -- utilisateur qui a créé l'info + "remise" real DEFAULT 0, -- remise systématique pour le client + "note" text +); + diff --git a/pgsql/tables/llx_lieu_concert.sql b/pgsql/tables/llx_lieu_concert.sql index 9f294ec16f5..4e5494f734d 100644 --- a/pgsql/tables/llx_lieu_concert.sql +++ b/pgsql/tables/llx_lieu_concert.sql @@ -1,33 +1,36 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_lieu_concert -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - nom varchar(64) NOT NULL, - description text, - ville varchar(64) NOT NULL, - fk_user_author integer -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_lieu_concert +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "nom" varchar(64) NOT NULL, + "description" text, + "ville" varchar(64) NOT NULL, + "fk_user_author" integer +); + diff --git a/pgsql/tables/llx_livre.sql b/pgsql/tables/llx_livre.sql index 588b8ef1df7..0b03a86806e 100644 --- a/pgsql/tables/llx_livre.sql +++ b/pgsql/tables/llx_livre.sql @@ -1,45 +1,44 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_livre -( - rowid SERIAL PRIMARY KEY, - oscid integer NOT NULL, - tms timestamp, - status smallint, - date_ajout timestamp without time zone, - ref varchar(12), - title varchar(64), - annee smallint, - description text, - prix decimal(15,4), - fk_editeur integer, - fk_user_author integer, - frais_de_port smallint DEFAULT 1, - -UNIQUE(ref) - -); - - - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_livre +( + rowid SERIAL PRIMARY KEY, + "oscid" integer NOT NULL, + "tms" timestamp, + "status" tinyint, + "date_ajout" datetime, + "ref" varchar(12), + "title" varchar(64), + "annee" int2, + "description" text, + "prix" decimal(15,4), + "fk_editeur" integer, + "fk_user_author" integer, + "frais_de_port" tinyint DEFAULT 1 +); + diff --git a/pgsql/tables/llx_livre_to_auteur.sql b/pgsql/tables/llx_livre_to_auteur.sql index 5fd1a8c74e3..8c61d96b32b 100644 --- a/pgsql/tables/llx_livre_to_auteur.sql +++ b/pgsql/tables/llx_livre_to_auteur.sql @@ -1,31 +1,32 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_livre_to_auteur -( - fk_livre integer NOT NULL, - fk_auteur integer NOT NULL, - - UNIQUE(fk_livre, fk_auteur) -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_livre_to_auteur +( + "fk_livre" integer NOT NULL, + "fk_auteur" integer NOT NULL +); diff --git a/pgsql/tables/llx_mailing.sql b/pgsql/tables/llx_mailing.sql new file mode 100644 index 00000000000..4137dec5caf --- /dev/null +++ b/pgsql/tables/llx_mailing.sql @@ -0,0 +1,59 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== +-- +-- redaction : 0 +-- valide : 1 +-- approuvé : 2 +-- envoye : 3 + + + + + + + + +create table llx_mailing +( + rowid SERIAL PRIMARY KEY, + "statut" smallint DEFAULT 0, -- + "date_envoi" datetime, -- date d'envoi + "titre" varchar(60), -- company name + "sujet" varchar(60), -- company name + "body" text, + "cible" varchar(60), + "nbemail" integer, + "email_from" varchar(160), -- company name + "email_replyto" varchar(160), -- company name + "email_errorsto" varchar(160), -- company name + "date_creat" datetime, -- creation date + "date_valid" datetime, -- creation date + "date_appro" datetime, -- creation date + "fk_user_creat" integer, -- utilisateur qui a créé l'info + "fk_user_valid" integer, -- utilisateur qui a créé l'info + "fk_user_appro" integer -- utilisateur qui a créé l'info +); + diff --git a/pgsql/tables/llx_mailing_cibles.key.sql b/pgsql/tables/llx_mailing_cibles.key.sql new file mode 100644 index 00000000000..7608dfc19a2 --- /dev/null +++ b/pgsql/tables/llx_mailing_cibles.key.sql @@ -0,0 +1,28 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + + +ALTER TABLE llx_mailing_cibles ADD UNIQUE uk_mailing_cibles (fk_mailing, email); diff --git a/pgsql/tables/llx_mailing_cibles.sql b/pgsql/tables/llx_mailing_cibles.sql new file mode 100644 index 00000000000..605722d9985 --- /dev/null +++ b/pgsql/tables/llx_mailing_cibles.sql @@ -0,0 +1,39 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== +-- + + + +create table llx_mailing_cibles +( + rowid SERIAL PRIMARY KEY, + "fk_mailing" integer NOT NULL, + "fk_contact" integer NOT NULL, + "nom" varchar(160), + "prenom" varchar(160), + "email" varchar(160) NOT NULL +); + diff --git a/pgsql/tables/llx_models.sql b/pgsql/tables/llx_models.sql new file mode 100644 index 00000000000..3f902ac2084 --- /dev/null +++ b/pgsql/tables/llx_models.sql @@ -0,0 +1,36 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_models +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "type" varchar(32), -- Fonction destinee au modele + "public" smallint DEFAULT 1 NOT NULL, -- Model publique ou privee + "fk_user" integer, -- Id utilisateur si privee, sinon null + "title" varchar(128), -- Titre modele + "content" text -- Texte du modele +); diff --git a/pgsql/tables/llx_newsletter.sql b/pgsql/tables/llx_newsletter.sql index ddffc6fe5c5..4b0ced2e831 100644 --- a/pgsql/tables/llx_newsletter.sql +++ b/pgsql/tables/llx_newsletter.sql @@ -1,45 +1,49 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_newsletter -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - email_subject varchar(32) NOT NULL, - email_from_name varchar(255) NOT NULL, - email_from_email varchar(255) NOT NULL, - email_replyto varchar(255) NOT NULL, - email_body text, - target smallint, - sql_target text, - status smallint DEFAULT 0 NOT NULL, - date_send_request timestamp without time zone, -- debut de l'envoi demandé - date_send_begin timestamp without time zone, -- debut de l'envoi - date_send_end timestamp without time zone, -- fin de l'envoi - nbsent integer, -- nombre de mails envoyés - nberror integer, -- nombre de mails envoyés - fk_user_author integer, - fk_user_valid integer, - fk_user_modif integer -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_newsletter +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "email_subject" varchar(32) NOT NULL, + "email_from_name" varchar(255) NOT NULL, + "email_from_email" varchar(255) NOT NULL, + "email_replyto" varchar(255) NOT NULL, + "email_body" text, + "target" smallint, + "sql_target" text, + "status" smallint DEFAULT 0 NOT NULL, + "date_send_request" datetime, -- debut de l'envoi demandé + "date_send_begin" datetime, -- debut de l'envoi + "date_send_end" datetime, -- fin de l'envoi + "nbsent" integer, -- nombre de mails envoyés + "nberror" integer, -- nombre de mails envoyés + "fk_user_author" integer, + "fk_user_valid" integer, + "fk_user_modif" integer +); + diff --git a/pgsql/tables/llx_notify.sql b/pgsql/tables/llx_notify.sql index b81f72ddb43..f391c438082 100644 --- a/pgsql/tables/llx_notify.sql +++ b/pgsql/tables/llx_notify.sql @@ -1,33 +1,36 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_notify -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - daten timestamp without time zone, -- date de la notification - fk_action integer NOT NULL, - fk_contact integer NOT NULL, - objet_type CHAR(10) CHECK (objet_type IN ('ficheinter','facture','propale')), - objet_id integer NOT NULL -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_notify +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "daten" datetime, -- date de la notification + "fk_action" integer NOT NULL, + "fk_contact" integer NOT NULL, + "objet_type" varchar(10) CHECK (objet_type IN ('ficheinter','facture','propale')) , + "objet_id" integer NOT NULL +); diff --git a/pgsql/tables/llx_notify_def.sql b/pgsql/tables/llx_notify_def.sql index d483c23c888..4632570fd05 100644 --- a/pgsql/tables/llx_notify_def.sql +++ b/pgsql/tables/llx_notify_def.sql @@ -1,32 +1,35 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_notify_def -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - datec date, -- date de creation - fk_action integer NOT NULL, - fk_soc integer NOT NULL, - fk_contact integer NOT NULL -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_notify_def +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datec" date, -- date de creation + "fk_action" integer NOT NULL, + "fk_soc" integer NOT NULL, + "fk_contact" integer NOT NULL +); diff --git a/pgsql/tables/llx_paiement.sql b/pgsql/tables/llx_paiement.sql index 6712d39d71d..ad9b863ba61 100644 --- a/pgsql/tables/llx_paiement.sql +++ b/pgsql/tables/llx_paiement.sql @@ -1,38 +1,49 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_paiement -( - rowid SERIAL PRIMARY KEY, - fk_facture integer, - datec timestamp without time zone, -- date de creation - tms timestamp, - datep timestamp without time zone, -- payment date - amount real DEFAULT 0, - author varchar(50), - fk_paiement integer NOT NULL, - num_paiement varchar(50), - note text, - fk_bank integer NOT NULL, - fk_user_creat integer, -- utilisateur qui a créé l'info - fk_user_modif integer -- utilisateur qui a modifié l'info -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== +-- +-- +-- Satut, 0 ou 1, 1 n'est plus supprimable +-- fk_export_compta 0 pas exporté + + +create table llx_paiement +( + rowid SERIAL PRIMARY KEY, + "fk_facture" integer, + "datec" datetime, -- date de creation + "tms" timestamp, + "datep" datetime, -- payment date + "amount" real DEFAULT 0, + "author" varchar(50), + "fk_paiement" integer NOT NULL, + "num_paiement" varchar(50), + "note" text, + "fk_bank" integer NOT NULL, + "fk_user_creat" integer, -- utilisateur qui a créé l'info + "fk_user_modif" integer, -- utilisateur qui a modifié l'info + "statut" smallint DEFAULT 0 NOT NULL, + "fk_export_compta" integer DEFAULT 0 NOT NULL +); diff --git a/pgsql/tables/llx_paiement_facture.key.sql b/pgsql/tables/llx_paiement_facture.key.sql new file mode 100644 index 00000000000..bd51d1a6bd9 --- /dev/null +++ b/pgsql/tables/llx_paiement_facture.key.sql @@ -0,0 +1,32 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + +-- Supprimme orhpelins pour permettre montée de la clé +DELETE llx_paiement_facture FROM llx_paiement_facture LEFT JOIN llx_facture ON llx_paiement_facture.fk_facture = llx_facture.rowid WHERE llx_facture.rowid IS NULL; +DELETE llx_paiement_facture FROM llx_paiement_facture LEFT JOIn llx_paiement ON llx_paiement_facture.fk_facture = llx_paiement.rowid WHERE llx_paiement.rowid IS NULL; + +ALTER TABLE llx_paiement_facture ADD CONSTRAINT paiement_facture_fk_facture FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid); +ALTER TABLE llx_paiement_facture ADD CONSTRAINT paiement_facture_fk_paiement FOREIGN KEY (fk_paiement) REFERENCES llx_paiement (rowid); diff --git a/pgsql/tables/llx_paiement_facture.sql b/pgsql/tables/llx_paiement_facture.sql index f2adc28fe8d..161d31c957f 100644 --- a/pgsql/tables/llx_paiement_facture.sql +++ b/pgsql/tables/llx_paiement_facture.sql @@ -1,34 +1,36 @@ --- =================================================================== --- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_paiement_facture -( - rowid serial PRIMARY KEY, - fk_paiement integer, - fk_facture integer, - amount real DEFAULT 0 -); - -CREATE INDEX llx_paiement_facture_fk_paiement ON llx_paiement_facture(fk_paiement); - -CREATE INDEX llx_paiement_facture_fk_facture ON llx_paiement_facture(fk_facture); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + + +create table llx_paiement_facture +( + rowid SERIAL PRIMARY KEY, + "fk_paiement" integer, + "fk_facture" integer, + "amount" real DEFAULT 0, + + key (fk_paiement), + key (fk_facture) +); diff --git a/pgsql/tables/llx_paiementcharge.sql b/pgsql/tables/llx_paiementcharge.sql index 48dea389d45..b27b179b54b 100644 --- a/pgsql/tables/llx_paiementcharge.sql +++ b/pgsql/tables/llx_paiementcharge.sql @@ -1,39 +1,41 @@ --- =================================================================== --- Copyright (C) 2004 Laurent Destailleur --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_paiementcharge -( - rowid serial PRIMARY KEY, - fk_charge integer, - datec timestamp without time zone, -- date de creation - tms timestamp, - datep timestamp without time zone, -- payment date - amount real DEFAULT 0, - fk_typepaiement integer NOT NULL, - num_paiement varchar(50), - note text, - fk_bank integer NOT NULL, - fk_user_creat integer, -- utilisateur qui a créé l'info - fk_user_modif integer -- utilisateur qui a modifié l'info - -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + + +create table llx_paiementcharge +( + rowid SERIAL PRIMARY KEY, + "fk_charge" integer, + "datec" datetime, -- date de creation + "tms" timestamp, + "datep" datetime, -- payment date + "amount" real DEFAULT 0, + "fk_typepaiement" integer NOT NULL, + "num_paiement" varchar(50), + "note" text, + "fk_bank" integer NOT NULL, + "fk_user_creat" integer, -- utilisateur qui a créé l'info + "fk_user_modif" integer -- utilisateur qui a modifié l'info +); diff --git a/pgsql/tables/llx_paiementfourn.sql b/pgsql/tables/llx_paiementfourn.sql index 579b15535f2..078ed824333 100644 --- a/pgsql/tables/llx_paiementfourn.sql +++ b/pgsql/tables/llx_paiementfourn.sql @@ -1,37 +1,40 @@ --- =================================================================== --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_paiementfourn -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - datec timestamp without time zone, -- date de creation de l'enregistrement - fk_facture_fourn integer, -- facture - datep timestamp without time zone, -- date de paiement - amount real DEFAULT 0, -- montant - fk_user_author integer, -- auteur - fk_paiement integer NOT NULL, -- moyen de paiement - num_paiement varchar(50), -- numéro de paiement (cheque) - note text, - fk_bank integer NOT NULL -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2003-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_paiementfourn +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datec" datetime, -- date de creation de l'enregistrement + "fk_facture_fourn" integer, -- facture + "datep" datetime, -- date de paiement + "amount" real DEFAULT 0, -- montant + "fk_user_author" integer, -- auteur + "fk_paiement" integer NOT NULL, -- moyen de paiement + "num_paiement" varchar(50), -- numéro de paiement (cheque) + "note" text, + "fk_bank" integer NOT NULL +); diff --git a/pgsql/tables/llx_pointmort.sql b/pgsql/tables/llx_pointmort.sql index 2fcacdbfd83..6ff343d1347 100644 --- a/pgsql/tables/llx_pointmort.sql +++ b/pgsql/tables/llx_pointmort.sql @@ -1,28 +1,31 @@ --- =================================================================== --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_pointmort -( - month timestamp without time zone, - amount real -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_pointmort +( + "month" datetime, + "amount" real +); + diff --git a/pgsql/tables/llx_prelevement.sql b/pgsql/tables/llx_prelevement.sql new file mode 100644 index 00000000000..4c23efc197c --- /dev/null +++ b/pgsql/tables/llx_prelevement.sql @@ -0,0 +1,42 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== +-- +-- + +create table llx_prelevement +( + rowid SERIAL PRIMARY KEY, + "ref" varchar(12), -- reference + "datec" datetime, -- date de creation + "amount" real DEFAULT 0, -- montant total du prelevement + "credite" smallint DEFAULT 0, -- indique si le prelevement a été credité + "note" text, + "date_trans" datetime, + "method_trans" smallint, + "fk_user_trans" integer, + "date_credit" datetime, + "fk_user_credit" integer, + +); diff --git a/pgsql/tables/llx_prelevement_bons.sql b/pgsql/tables/llx_prelevement_bons.sql new file mode 100644 index 00000000000..976f84602fd --- /dev/null +++ b/pgsql/tables/llx_prelevement_bons.sql @@ -0,0 +1,46 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== +-- +-- Bons de prélèvement +-- +-- statut 1 : transmis à la banque +-- statut 2 : credite +-- +create table llx_prelevement_bons +( + rowid SERIAL PRIMARY KEY, + "ref" varchar(12), -- reference + "datec" datetime, -- date de creation + "amount" real DEFAULT 0, -- montant total du prélèvement + "statut" smallint DEFAULT 0, -- statut + "credite" smallint DEFAULT 0, -- indique si le prelevement a été credité + "note" text, + "date_trans" datetime, -- date de transmission à la banque + "method_trans" smallint, -- méthode de transmission + "fk_user_trans" integer, -- user qui a effectué la transmission + "date_credit" datetime, -- date de crédit sur le compte + "fk_user_credit" integer, -- user qui a remonté l'info de crédit + +); diff --git a/pgsql/tables/llx_prelevement_facture.sql b/pgsql/tables/llx_prelevement_facture.sql new file mode 100644 index 00000000000..6e2ddbd64d5 --- /dev/null +++ b/pgsql/tables/llx_prelevement_facture.sql @@ -0,0 +1,34 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== +-- +-- + +create table llx_prelevement_facture +( + rowid SERIAL PRIMARY KEY, + "fk_facture" integer NOT NULL, + "fk_prelevement" integer NOT NULL, + "statut" smallint DEFAULT 0 +); diff --git a/pgsql/tables/llx_prelevement_facture_demande.sql b/pgsql/tables/llx_prelevement_facture_demande.sql new file mode 100644 index 00000000000..59bbbef0d88 --- /dev/null +++ b/pgsql/tables/llx_prelevement_facture_demande.sql @@ -0,0 +1,44 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== +-- +-- + + + +create table llx_prelevement_facture_demande +( + rowid SERIAL PRIMARY KEY, + "fk_facture" integer NOT NULL, + "amount" real NOT NULL, + "date_demande" datetime, + "traite" smallint DEFAULT 0, + "date_traite" datetime, + "fk_prelevement" integer, + "fk_user_demande" integer NOT NULL, + "code_banque" varchar(7), + "code_guichet" varchar(6), + "number" varchar(255), + "cle_rib" varchar(5) +); diff --git a/pgsql/tables/llx_prelevement_rejet.sql b/pgsql/tables/llx_prelevement_rejet.sql new file mode 100644 index 00000000000..d488d46ecd7 --- /dev/null +++ b/pgsql/tables/llx_prelevement_rejet.sql @@ -0,0 +1,39 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== +-- +-- + + +create table llx_prelevement_rejet +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer NOT NULL, + "fk_prelevement" integer, + "amount" real DEFAULT 0, -- montant total du prelevement + "motif" integer, + "note" text, + "date_creation" datetime, + "fk_user_creation" integer +); diff --git a/pgsql/tables/llx_product.sql b/pgsql/tables/llx_product.sql index cccb0ea920f..31a25894877 100644 --- a/pgsql/tables/llx_product.sql +++ b/pgsql/tables/llx_product.sql @@ -1,42 +1,48 @@ --- =================================================================== --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_product -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - ref varchar(15) UNIQUE, - label varchar(255), - description text, - price double precision, - tva_tx double precision DEFAULT 19.6, - fk_user_author integer, - envente smallint DEFAULT 1, - nbvente integer DEFAULT 0, - fk_product_type integer DEFAULT 0, - duration varchar(6), - stock_propale integer DEFAULT 0, - stock_commande integer DEFAULT 0, - seuil_stock_alerte integer DEFAULT 0 -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_product +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "label" varchar(255), + "description" text, + "price" double, + "tva_tx" double DEFAULT 19.6, + "fk_user_author" integer, + "envente" tinyint DEFAULT 1, + "nbvente" integer DEFAULT 0, + "fk_product_type" integer DEFAULT 0, + "duration" varchar(6), + "stock_propale" integer DEFAULT 0, + "stock_commande" integer DEFAULT 0, + "seuil_stock_alerte" integer DEFAULT 0 +); + + + diff --git a/pgsql/tables/llx_product_fournisseur.sql b/pgsql/tables/llx_product_fournisseur.sql index 77b84780874..4137a830343 100644 --- a/pgsql/tables/llx_product_fournisseur.sql +++ b/pgsql/tables/llx_product_fournisseur.sql @@ -1,37 +1,41 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_product_fournisseur -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - fk_product integer, - fk_soc integer, - ref_fourn varchar(30), - fk_user_author integer -); - -CREATE INDEX llx_product_fournisseur_fk_product ON llx_product_fournisseur (fk_product); - -CREATE INDEX llx_product_fournisseur_fk_soc ON llx_product_fournisseur (fk_soc); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_product_fournisseur +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "fk_product" integer, + "fk_soc" integer, + "ref_fourn" varchar(30), + "fk_user_author" integer +); + +CREATE INDEX llx_product_fournisseur_fk_product ON llx_product_fournisseur (fk_product); +CREATE INDEX llx_product_fournisseur_fk_soc ON llx_product_fournisseur (fk_soc); + diff --git a/pgsql/tables/llx_product_fournisseur_price.key.sql b/pgsql/tables/llx_product_fournisseur_price.key.sql new file mode 100644 index 00000000000..e370e0b46bb --- /dev/null +++ b/pgsql/tables/llx_product_fournisseur_price.key.sql @@ -0,0 +1,36 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +ALTER TABLE llx_product_fournisseur_price ADD INDEX (fk_user); +ALTER TABLE llx_product_fournisseur_price ADD INDEX (fk_soc); +ALTER TABLE llx_product_fournisseur_price ADD INDEX (fk_product); + +ALTER TABLE llx_product_fournisseur_price ADD FOREIGN KEY (fk_user) REFERENCES llx_user (rowid); +ALTER TABLE llx_product_fournisseur_price ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); +ALTER TABLE llx_product_fournisseur_price ADD FOREIGN KEY (fk_product) REFERENCES llx_product (rowid); + + diff --git a/pgsql/tables/llx_product_fournisseur_price.sql b/pgsql/tables/llx_product_fournisseur_price.sql new file mode 100644 index 00000000000..5eccffa199d --- /dev/null +++ b/pgsql/tables/llx_product_fournisseur_price.sql @@ -0,0 +1,38 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_product_fournisseur_price +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "fk_product" integer, + "fk_soc" integer, -- lien sur llx_societe + "price" real, + "quantity" real, + "fk_user" integer +); diff --git a/pgsql/tables/llx_product_price.sql b/pgsql/tables/llx_product_price.sql index e60fcadd5c1..76649b0f4cc 100644 --- a/pgsql/tables/llx_product_price.sql +++ b/pgsql/tables/llx_product_price.sql @@ -1,35 +1,38 @@ --- ============================================================================ --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_product_price -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - fk_product integer NOT NULL, - date_price timestamp without time zone NOT NULL, - price double precision, - tva_tx double precision DEFAULT 19.6, - fk_user_author integer, - envente smallint DEFAULT 1 -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_product_price +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "fk_product" integer NOT NULL, + "date_price" datetime, + "price" double, + "tva_tx" double DEFAULT 19.6, + "fk_user_author" integer, + "envente" tinyint DEFAULT 1 +); + diff --git a/pgsql/tables/llx_product_stock.sql b/pgsql/tables/llx_product_stock.sql index 35846b38022..f511510eb99 100644 --- a/pgsql/tables/llx_product_stock.sql +++ b/pgsql/tables/llx_product_stock.sql @@ -1,36 +1,39 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_product_stock -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - fk_product integer NOT NULL, - fk_stock integer NOT NULL, - reel integer --stock réel -); - -CREATE INDEX llx_product_stock_fk_product ON llx_product_stock (fk_product); - -CREATE INDEX llx_product_stock_fk_stock ON llx_product_stock (fk_stock); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_product_stock +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "fk_product" integer NOT NULL, + "fk_entrepot" integer NOT NULL, + "reel" integer, -- stock réel +); + +CREATE INDEX llx_product_stock_fk_product ON llx_product_stock (fk_product); +CREATE INDEX llx_product_stock_fk_entrepot ON llx_product_stock (fk_entrepot); + diff --git a/pgsql/tables/llx_projet.sql b/pgsql/tables/llx_projet.sql index e07bfe07337..c0086e2c61c 100644 --- a/pgsql/tables/llx_projet.sql +++ b/pgsql/tables/llx_projet.sql @@ -1,39 +1,41 @@ --- =========================================================================== --- Copyright (C) 2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_projet -( - rowid SERIAL PRIMARY KEY, - fk_soc integer NOT NULL, - fk_statut smallint NOT NULL, - tms timestamp, - dateo date, -- date d'ouverture du projet - ref varchar(50), - title varchar(255), - fk_user_resp integer, -- responsable du projet - fk_user_creat integer, -- createur du projet - note text -); - -create unique index llx_projet_ref on llx_projet(ref); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =========================================================================== +-- Copyright (C) 2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + + +create table llx_projet +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer NOT NULL, + "fk_statut" smallint NOT NULL, + "tms" timestamp, + "dateo" date, -- date d'ouverture du projet + "ref" varchar(50), + "title" varchar(255), + "fk_user_resp" integer, -- responsable du projet + "fk_user_creat" integer, -- createur du projet + "note" text +); diff --git a/pgsql/tables/llx_propal.key.sql b/pgsql/tables/llx_propal.key.sql new file mode 100644 index 00000000000..9800e2e2bdf --- /dev/null +++ b/pgsql/tables/llx_propal.key.sql @@ -0,0 +1,31 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2002-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +ALTER TABLE llx_propal ADD INDEX (fk_soc); + +ALTER TABLE llx_propal ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); + diff --git a/pgsql/tables/llx_propal.sql b/pgsql/tables/llx_propal.sql index 2d512368d4a..d5c83d49ae8 100644 --- a/pgsql/tables/llx_propal.sql +++ b/pgsql/tables/llx_propal.sql @@ -1,51 +1,50 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_propal -( - rowid SERIAL PRIMARY KEY, - fk_soc integer, - fk_soc_contact integer, - fk_projet integer DEFAULT 0, -- projet auquel est rattache la propale - ref varchar(30) NOT NULL, -- propal number - datec timestamp without time zone, -- date de creation - fin_validite timestamp without time zone, -- date de fin de validite - date_valid timestamp without time zone, -- date de validation - date_cloture timestamp without time zone, -- date de cloture - datep date, -- date de la propal - fk_user_author integer, -- createur de la propale - fk_user_valid integer, -- valideur de la propale - fk_user_cloture integer, -- cloture de la propale signee ou non signee - fk_statut smallint DEFAULT 0, - price real DEFAULT 0, - remise_percent real DEFAULT 0, - remise real DEFAULT 0, - tva real DEFAULT 0, - total real DEFAULT 0, - note text, - model_pdf varchar(50) -); - -create unique index llx_propal_ref on llx_propal(ref); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_propal +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer, + "fk_soc_contact" integer, + "fk_projet" integer DEFAULT 0, -- projet auquel est rattache la propale + "ref" varchar(30) NOT NULL, -- propal number + "datec" datetime, -- date de creation + "fin_validite" datetime, -- date de fin de validite + "date_valid" datetime, -- date de validation + "date_cloture" datetime, -- date de cloture + "datep" date, -- date de la propal + "fk_user_author" integer, -- createur de la propale + "fk_user_valid" integer, -- valideur de la propale + "fk_user_cloture" integer, -- cloture de la propale signee ou non signee + "fk_statut" smallint DEFAULT 0, + "price" real DEFAULT 0, + "remise_percent" real DEFAULT 0, + "remise" real DEFAULT 0, + "tva" real DEFAULT 0, + "total" real DEFAULT 0, + "note" text, + "model_pdf" varchar(50), +4294967294); diff --git a/pgsql/tables/llx_propal_model_pdf.sql b/pgsql/tables/llx_propal_model_pdf.sql index 68cabbb34a8..451e36da0c8 100644 --- a/pgsql/tables/llx_propal_model_pdf.sql +++ b/pgsql/tables/llx_propal_model_pdf.sql @@ -1,31 +1,34 @@ --- =================================================================== --- Copyright (C) 2001-2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- Liste des modeles de propale pdf disponibles --- --- =================================================================== - -create table llx_propal_model_pdf -( - nom varchar(50) PRIMARY KEY, - libelle varchar(255), - description text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- Liste des modeles de propale pdf disponibles +-- +-- =================================================================== + +create table llx_propal_model_pdf +( + nom varchar(50) PRIMARY KEY, + "libelle" varchar(255), + "description" text +); diff --git a/pgsql/tables/llx_propaldet.sql b/pgsql/tables/llx_propaldet.sql index a612953cb06..ff3255642ae 100644 --- a/pgsql/tables/llx_propaldet.sql +++ b/pgsql/tables/llx_propaldet.sql @@ -1,37 +1,38 @@ --- =================================================================== --- Copyright (C) 2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_propaldet -( - rowid SERIAL PRIMARY KEY, - fk_propal integer, - fk_product integer, - description text, - tva_tx real DEFAULT 19.6, -- taux tva - qty real, -- quantité - remise_percent real DEFAULT 0, -- pourcentage de remise - remise real DEFAULT 0, -- montant de la remise - subprice real, -- prix avant remise - price real -- prix final -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_propaldet +( + rowid SERIAL PRIMARY KEY, + "fk_propal" integer, + "fk_product" integer, + "description" text, + "tva_tx" real DEFAULT 19.6, -- taux tva + "qty" real, -- quantité + "remise_percent" real DEFAULT 0, -- pourcentage de remise + "remise" real DEFAULT 0, -- montant de la remise + "subprice" real, -- prix avant remise + "price" real -- prix final +); diff --git a/pgsql/tables/llx_rights_def.sql b/pgsql/tables/llx_rights_def.sql index 407a2663105..1756f50b686 100644 --- a/pgsql/tables/llx_rights_def.sql +++ b/pgsql/tables/llx_rights_def.sql @@ -1,32 +1,37 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_rights_def -( - id integer PRIMARY KEY, - libelle varchar(255), - module varchar(12), - type CHAR CHECK (type IN ('r','w','m','d','a')), - bydefault smallint DEFAULT 0 -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + +create table llx_rights_def +( + id integer PRIMARY KEY, + "libelle" varchar(255), + "module" varchar(12), + "perms" varchar(50), + "subperms" varchar(50), + "type" varchar(1) CHECK (type IN ('r','w','m','d','a')) , + "bydefault" tinyint DEFAULT 0 +); + diff --git a/pgsql/tables/llx_so_gr.sql b/pgsql/tables/llx_so_gr.sql new file mode 100644 index 00000000000..71b680deb61 --- /dev/null +++ b/pgsql/tables/llx_so_gr.sql @@ -0,0 +1,35 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- Table de liaison des sociétés dans les groupes. +-- =================================================================== + + + +create table llx_so_gr +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer, + "fk_groupe" integer +); diff --git a/pgsql/tables/llx_soc_events.sql b/pgsql/tables/llx_soc_events.sql index 5574d742bd9..d654836d33a 100644 --- a/pgsql/tables/llx_soc_events.sql +++ b/pgsql/tables/llx_soc_events.sql @@ -1,34 +1,36 @@ --- ======================================================================== --- Copyright (C) 2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 ?ric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_soc_events -( - rowid SERIAL PRIMARY KEY, -- public id - fk_soc int NOT NULL, - dateb timestamp without time zone NOT NULL, -- begin date - datee timestamp without time zone NOT NULL, -- end date - title varchar(100) NOT NULL, - url varchar(255), - description text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + +create table llx_soc_events +( + rowid SERIAL PRIMARY KEY, -- public id + "fk_soc" int NOT NULL, -- + "dateb" datetime NOT NULL, -- begin date + "datee" datetime NOT NULL, -- end date + "title" varchar(100) NOT NULL, + "url" varchar(255), + "description" text +); diff --git a/pgsql/tables/llx_soc_recontact.sql b/pgsql/tables/llx_soc_recontact.sql index 22bcb685999..b518d128890 100644 --- a/pgsql/tables/llx_soc_recontact.sql +++ b/pgsql/tables/llx_soc_recontact.sql @@ -1,33 +1,35 @@ --- =================================================================== --- Copyright (C) 2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- Societes a recontacter --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_soc_recontact -( - rowid SERIAL PRIMARY KEY, - fk_soc integer, - datere timestamp without time zone, - author varchar(15) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- Societes a recontacter +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_soc_recontact +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer, + "datere" datetime, + "author" varchar(15) +); diff --git a/pgsql/tables/llx_societe.sql b/pgsql/tables/llx_societe.sql index c71ad3ac004..b6d93633045 100644 --- a/pgsql/tables/llx_societe.sql +++ b/pgsql/tables/llx_societe.sql @@ -1,65 +1,69 @@ --- ======================================================================== --- Copyright (C) 2000-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Eric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_societe -( - idp SERIAL PRIMARY KEY, - id varchar(32), -- private id - active smallint DEFAULT 0, -- - parent integer DEFAULT 0, -- - tms timestamp, - datec timestamp without time zone, -- creation date - datea timestamp without time zone, -- activation date - nom varchar(60), -- company name - address varchar(255), -- company adresse - cp varchar(10), -- zipcode - ville varchar(50), -- town - fk_departement integer DEFAULT 0, -- - fk_pays integer DEFAULT 0, -- - tel varchar(20), -- phone number - fax varchar(20), -- fax number - url varchar(255), -- - fk_secteur integer DEFAULT 0, -- - fk_effectif integer DEFAULT 0, -- - fk_typent integer DEFAULT 0, -- - fk_forme_juridique integer DEFAULT 0, -- forme juridique INSEE - siren varchar(9), -- - siret varchar(14), -- numero de siret - ape varchar(4), -- code ape - tva_intra varchar(20), -- tva intracommunautaire - capital real, -- capital de la société - description text, -- - fk_stcomm smallint DEFAULT 0, -- commercial statut - note text, -- - services integer DEFAULT 0, -- - prefix_comm varchar(5), -- prefix commercial - client integer DEFAULT 0, -- client oui/non - fournisseur smallint DEFAULT 0, -- fournisseur oui/non - rubrique varchar(255), -- champ rubrique libre - fk_user_creat integer, -- utilisateur qui a créé l'info - fk_user_modif integer, -- utilisateur qui a modifié l'info - remise_client real DEFAULT 0 -- remise systématique pour le client -); - -create unique index llx_societe_prefix_comm on llx_societe(prefix_comm); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2000-2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + + +create table llx_societe +( + idp SERIAL PRIMARY KEY, + "id" varchar(32), -- private id + "active" smallint DEFAULT 0, -- + "parent" integer DEFAULT 0, -- + "tms" timestamp, + "datec" datetime, -- creation date + "datea" datetime, -- activation date + "nom" varchar(60), -- company name + "code_client" varchar(15), -- code client + "code_compta" varchar(15), -- code compta + "address" varchar(255), -- company adresse + "cp" varchar(10), -- zipcode + "ville" varchar(50), -- town + "fk_departement" integer DEFAULT 0, -- + "fk_pays" integer DEFAULT 0, -- + "tel" varchar(20), -- phone number + "fax" varchar(20), -- fax number + "url" varchar(255), -- + "fk_secteur" integer DEFAULT 0, -- + "fk_effectif" integer DEFAULT 0, -- + "fk_typent" integer DEFAULT 0, -- + "fk_forme_juridique" integer DEFAULT 0, -- forme juridique INSEE + "siren" varchar(9), -- siren ou RCS + "siret" varchar(14), -- numero de siret + "ape" varchar(4), -- code ape + "tva_intra" varchar(20), -- tva intracommunautaire + "capital" real, -- capital de la société + "description" text, -- + "fk_stcomm" smallint DEFAULT 0, -- commercial statut + "note" text, -- + "services" integer DEFAULT 0, -- + "prefix_comm" varchar(5), -- prefix commercial + "client" integer DEFAULT 0, -- client oui/non + "fournisseur" smallint DEFAULT 0, -- fournisseur oui/non + "rubrique" varchar(255), -- champ rubrique libre + "fk_user_creat" integer, -- utilisateur qui a créé l'info + "fk_user_modif" integer, -- utilisateur qui a modifié l'info + "remise_client" real DEFAULT 0, -- remise systématique pour le client +); + diff --git a/pgsql/tables/llx_societe_commerciaux.sql b/pgsql/tables/llx_societe_commerciaux.sql new file mode 100644 index 00000000000..34395529776 --- /dev/null +++ b/pgsql/tables/llx_societe_commerciaux.sql @@ -0,0 +1,34 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ======================================================================== + + +create table llx_societe_commerciaux +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer, + "fk_user" integer +); + diff --git a/pgsql/tables/llx_societe_remise.sql b/pgsql/tables/llx_societe_remise.sql index e9fffb09b2d..e86569f02f8 100644 --- a/pgsql/tables/llx_societe_remise.sql +++ b/pgsql/tables/llx_societe_remise.sql @@ -1,35 +1,40 @@ --- ======================================================================== --- Copyright (C) 2000-2004 Rodolphe Quiedeville --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- Historique des remises clients --- --- ======================================================================== - -create table llx_societe_remise -( - rowid serial PRIMARY KEY, - fk_soc integer NOT NULL, - tms timestamp, - datec timestamp without time zone, -- creation date - fk_user_author integer, -- utilisateur qui a créé l'info - remise_client real DEFAULT 0, -- remise systématique pour le client - note text -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2000-2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- Historique des remises clients +-- +-- ======================================================================== + + +create table llx_societe_remise +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer NOT NULL, + "tms" timestamp, + "datec" datetime, -- creation date + "fk_user_author" integer, -- utilisateur qui a créé l'info + "remise_client" real DEFAULT 0, -- remise systématique pour le client + "note" text +); + diff --git a/pgsql/tables/llx_societe_remise_except.key.sql b/pgsql/tables/llx_societe_remise_except.key.sql new file mode 100644 index 00000000000..3925e33e3d6 --- /dev/null +++ b/pgsql/tables/llx_societe_remise_except.key.sql @@ -0,0 +1,41 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- Remises exceptionnelles +-- +-- +-- ============================================================================ + + + +ALTER TABLE llx_societe_remise_except ADD INDEX (fk_user); +ALTER TABLE llx_societe_remise_except ADD INDEX (fk_soc); +ALTER TABLE llx_societe_remise_except ADD INDEX (fk_facture); + +ALTER TABLE llx_societe_remise_except ADD FOREIGN KEY (fk_user) REFERENCES llx_user (rowid); +ALTER TABLE llx_societe_remise_except ADD FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); +ALTER TABLE llx_societe_remise_except ADD FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid); + + + diff --git a/pgsql/tables/llx_cash_account.sql b/pgsql/tables/llx_societe_remise_except.sql similarity index 60% rename from pgsql/tables/llx_cash_account.sql rename to pgsql/tables/llx_societe_remise_except.sql index 967dbbe1ba1..ae6d10f3131 100644 --- a/pgsql/tables/llx_cash_account.sql +++ b/pgsql/tables/llx_societe_remise_except.sql @@ -1,37 +1,40 @@ --- ============================================================================= --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================= --- --- courant : indique si c'est un compte courant --- clos : le compte est-il clos ou encore ouvert --- --- ============================================================================= - -create table llx_cash_account -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - label varchar(30), - courant smallint DEFAULT 0 NOT NULL, - clos smallint DEFAULT 0 NOT NULL, - account_number varchar(8) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- Remises exceptionnelles +-- +-- +-- ============================================================================ + + +create table llx_societe_remise_except +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer NOT NULL, -- client + "datec" datetime, + "amount_ht" real NOT NULL, + "fk_user" integer NOT NULL, + "fk_facture" integer, + "description" text +); diff --git a/pgsql/tables/llx_societe_rib.sql b/pgsql/tables/llx_societe_rib.sql index 2b456b1d4a4..2be2e4cdc83 100644 --- a/pgsql/tables/llx_societe_rib.sql +++ b/pgsql/tables/llx_societe_rib.sql @@ -1,42 +1,48 @@ --- ============================================================================= --- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================= - -create table llx_societe_rib -( - rowid serial PRIMARY KEY, - fk_soc integer NOT NULL, - datec timestamp without time zone, - tms timestamp, - label varchar(30), - bank varchar(255), - code_banque varchar(7), - code_guichet varchar(6), - number varchar(255), - cle_rib varchar(5), - bic varchar(10), - iban_prefix varchar(5), - domiciliation varchar(255), - proprio varchar(60), - adresse_proprio varchar(255) - -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================= +-- Copyright (C) 2000-2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- +-- +-- ============================================================================= + + + +create table llx_societe_rib +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer NOT NULL, + "datec" datetime, + "tms" timestamp, + "label" varchar(30), + "bank" varchar(255), + "code_banque" varchar(7), + "code_guichet" varchar(6), + "number" varchar(255), + "cle_rib" varchar(5), + "bic" varchar(10), + "iban_prefix" varchar(5), + "domiciliation" varchar(255), + "proprio" varchar(60), + "adresse_proprio" varchar(255) +); diff --git a/pgsql/tables/llx_socpeople.key.sql b/pgsql/tables/llx_socpeople.key.sql new file mode 100644 index 00000000000..2db579ea4a0 --- /dev/null +++ b/pgsql/tables/llx_socpeople.key.sql @@ -0,0 +1,28 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +ALTER TABLE llx_socpeople ADD CONSTRAINT socpeople_fk_soc_idp FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); diff --git a/pgsql/tables/llx_socpeople.sql b/pgsql/tables/llx_socpeople.sql index 88f744da30f..bd854e50023 100644 --- a/pgsql/tables/llx_socpeople.sql +++ b/pgsql/tables/llx_socpeople.sql @@ -1,48 +1,50 @@ --- ============================================================================ --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Eric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_socpeople -( - idp SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - fk_soc integer, -- lien vers la societe - civilite varchar(6), - name varchar(50), - firstname varchar(50), - address varchar(255), - birthday date, - poste varchar(80), - phone varchar(30), - phone_perso varchar(30), - phone_mobile varchar(30), - fax varchar(30), - email varchar(255), - jabberid varchar(255), - fk_user integer DEFAULT 0, -- user qui a créé l'enregistrement - fk_user_modif integer, - note text -); - -CREATE INDEX llx_socpeople_fk_soc ON llx_socpeople(fk_soc); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_socpeople +( + idp SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "fk_soc" integer, -- lien vers la societe + "civilite" varchar(6), + "name" varchar(50), + "firstname" varchar(50), + "address" varchar(255), + "cp" varchar(25), + "ville" varchar(255), + "birthday" date, + "poste" varchar(80), + "phone" varchar(30), + "phone_perso" varchar(30), + "phone_mobile" varchar(30), + "fax" varchar(30), + "email" varchar(255), + "jabberid" varchar(255), + "fk_user" integer DEFAULT 0, -- user qui a créé l'enregistrement + "fk_user_modif" integer, + "note" text +); diff --git a/pgsql/tables/llx_socstatutlog.sql b/pgsql/tables/llx_socstatutlog.sql index 1757c960391..f16c77682d3 100644 --- a/pgsql/tables/llx_socstatutlog.sql +++ b/pgsql/tables/llx_socstatutlog.sql @@ -1,32 +1,34 @@ --- ======================================================================== --- Copyright (C) 2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Eric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_socstatutlog -( - id SERIAL PRIMARY KEY, - datel timestamp without time zone, - fk_soc integer, - fk_statut integer, - author varchar(30) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ======================================================================== + +create table llx_socstatutlog +( + id SERIAL PRIMARY KEY, + "datel" datetime, + "fk_soc" integer, + "fk_statut" integer, + "author" varchar(30) +); diff --git a/pgsql/tables/llx_sqltables.sql b/pgsql/tables/llx_sqltables.sql index 4399de747c5..89de757d614 100644 --- a/pgsql/tables/llx_sqltables.sql +++ b/pgsql/tables/llx_sqltables.sql @@ -1,30 +1,33 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_sqltables -( - rowid SERIAL PRIMARY KEY, - name varchar(255), - loaded smallint -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_sqltables +( + rowid SERIAL PRIMARY KEY, + "name" varchar(255), + "loaded" int2 +); + diff --git a/pgsql/tables/llx_stock_mouvement.sql b/pgsql/tables/llx_stock_mouvement.sql index 44678d0fb5e..04287952cbf 100644 --- a/pgsql/tables/llx_stock_mouvement.sql +++ b/pgsql/tables/llx_stock_mouvement.sql @@ -1,38 +1,42 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_stock_mouvement -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - datem timestamp without time zone, - fk_product integer NOT NULL, - fk_stock integer NOT NULL, - value integer, - type_mouvement smallint, - fk_user_author integer -); - - CREATE INDEX llx_stock_mouvement_fk_product ON llx_stock_mouvement (fk_product); - - CREATE INDEX llx_stock_mouvement_fk_stock ON llx_stock_mouvement (fk_stock); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + + +create table llx_stock_mouvement +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datem" datetime, + "fk_product" integer NOT NULL, + "fk_entrepot" integer NOT NULL, + "value" integer, + "type_mouvement" smallint, + "fk_user_author" integer +); + +CREATE INDEX llx_stock_mouvement_fk_product ON llx_stock_mouvement (fk_product); +CREATE INDEX llx_stock_mouvement_fk_entrepot ON llx_stock_mouvement (fk_entrepot); + diff --git a/pgsql/tables/llx_todocomm.sql b/pgsql/tables/llx_todocomm.sql index 1d21947f718..6ef18c3f745 100644 --- a/pgsql/tables/llx_todocomm.sql +++ b/pgsql/tables/llx_todocomm.sql @@ -1,39 +1,42 @@ --- ======================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- Actions commerciales a effectuer --- --- $Id$ --- $Source$ --- --- ======================================================================== - -create table llx_todocomm -( - id SERIAL PRIMARY KEY, - datea timestamp without time zone, -- date de l'action - label varchar(50), -- libelle de l'action - fk_user_action integer, -- id de la personne qui doit effectuer l'action - fk_user_author integer, -- id auteur de l'action - fk_soc integer, -- id de la societe auquel est rattachee l'action - fk_contact integer, -- id du contact sur laquelle l'action - -- doit etre effectuee - note text -); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ======================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $Id$ +-- $Source$ +-- +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- Actions commerciales a effectuer +-- +-- ======================================================================== + +create table llx_todocomm +( + id SERIAL PRIMARY KEY, + "datea" datetime, -- date de l'action + "label" varchar(50), -- libelle de l'action + "fk_user_action" integer, -- id de la personne qui doit effectuer l'action + "fk_user_author" integer, -- id auteur de l'action + "fk_soc" integer, -- id de la societe auquel est rattachee l'action + "fk_contact" integer, -- id du contact sur laquelle l'action + -- doit etre effectuee + "note" text +); + diff --git a/pgsql/tables/llx_transaction_bplc.sql b/pgsql/tables/llx_transaction_bplc.sql index 0aa154a4f77..7f870e50164 100644 --- a/pgsql/tables/llx_transaction_bplc.sql +++ b/pgsql/tables/llx_transaction_bplc.sql @@ -1,35 +1,40 @@ --- =================================================================== --- Copyright 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_transaction_bplc -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - ipclient varchar(20), - num_transaction varchar(10), - date_transaction varchar(10), - heure_transaction varchar(10), - num_autorisation varchar(10), - cle_acceptation varchar(5), - code_retour varchar(4), - ref_commande integer -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + + +create table llx_transaction_bplc +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "ipclient" varchar(20), + "num_transaction" varchar(10), + "date_transaction" varchar(10), + "heure_transaction" varchar(10), + "num_autorisation" varchar(10), + "cle_acceptation" varchar(5), + "code_retour" integer, + "ref_commande" integer +); diff --git a/pgsql/tables/llx_tva.sql b/pgsql/tables/llx_tva.sql index e1449f6d00f..9bf1bd6f435 100644 --- a/pgsql/tables/llx_tva.sql +++ b/pgsql/tables/llx_tva.sql @@ -1,34 +1,36 @@ --- =================================================================== --- Copyright (C) 2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_tva -( - rowid SERIAL PRIMARY KEY, - tms timestamp, - datep date, -- date de paiement - datev date, -- date de valeur - amount real NOT NULL DEFAULT 0, - label varchar(255), - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_tva +( + rowid SERIAL PRIMARY KEY, + "tms" timestamp, + "datep" date, -- date de paiement + "datev" date, -- date de valeur + "amount" real NOT NULL DEFAULT 0, + "label" varchar(255), + "note" text +); diff --git a/pgsql/tables/llx_user.sql b/pgsql/tables/llx_user.sql index d60d4b436f8..720f9231e54 100644 --- a/pgsql/tables/llx_user.sql +++ b/pgsql/tables/llx_user.sql @@ -1,46 +1,46 @@ --- ============================================================================ --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_user -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - tms timestamp, - login varchar(8), - pass varchar(32), - name varchar(50), - firstname varchar(50), - code varchar(4), - email varchar(255), - admin smallint DEFAULT 0, - webcal_login varchar(25), - module_comm smallint DEFAULT 1, - module_compta smallint DEFAULT 1, - fk_societe integer DEFAULT 0, - fk_socpeople integer DEFAULT 0, - note text -); - -create unique index llx_user_login on llx_user(login); - +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2001-2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + +create table llx_user +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "login" varchar(8), + "pass" varchar(32), + "name" varchar(50), + "firstname" varchar(50), + "code" varchar(4), + "email" varchar(255), + "admin" smallint DEFAULT 0, + "webcal_login" varchar(25), + "module_comm" smallint DEFAULT 1, + "module_compta" smallint DEFAULT 1, + "fk_societe" integer DEFAULT 0, + "fk_socpeople" integer DEFAULT 0, + "note" text +); diff --git a/pgsql/tables/llx_user_alert.sql b/pgsql/tables/llx_user_alert.sql index 73d9ac49032..f793ab8f3cd 100644 --- a/pgsql/tables/llx_user_alert.sql +++ b/pgsql/tables/llx_user_alert.sql @@ -1,31 +1,34 @@ --- ============================================================================ --- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004 Laurent Destailleur --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - -create table llx_user_alert -( - rowid SERIAL PRIMARY KEY, - type integer, - fk_contact integer, -- pointe sur llx_socpeople - fk_user integer -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- ============================================================================ + +create table llx_user_alert +( + rowid SERIAL PRIMARY KEY, + "type" integer, + "fk_contact" integer, -- pointe sur llx_socpeople + "fk_user" integer +); diff --git a/pgsql/tables/llx_user_clicktodial.sql b/pgsql/tables/llx_user_clicktodial.sql new file mode 100644 index 00000000000..e6ef68c4b52 --- /dev/null +++ b/pgsql/tables/llx_user_clicktodial.sql @@ -0,0 +1,36 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== +-- +-- Stockage des informations relatives au click to dial +-- + +create table llx_user_clicktodial +( + fk_user integer PRIMARY KEY, + "login" varchar(32), + "pass" varchar(64), + "poste" varchar(20) +); diff --git a/pgsql/tables/llx_user_param.sql b/pgsql/tables/llx_user_param.sql index 0311a75e5b4..21914df0965 100644 --- a/pgsql/tables/llx_user_param.sql +++ b/pgsql/tables/llx_user_param.sql @@ -1,33 +1,35 @@ --- ============================================================================ --- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004 Laurent Destailleur --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_user_param -( - fk_user integer, - page varchar(255), - param varchar(64), - value varchar(255), - - UNIQUE (fk_user,page,param) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + +create table llx_user_param +( + "fk_user" integer, + "page" varchar(255), + "param" varchar(64), + "value" varchar(255) +); diff --git a/pgsql/tables/llx_user_rights.key.sql b/pgsql/tables/llx_user_rights.key.sql new file mode 100644 index 00000000000..d31783459ee --- /dev/null +++ b/pgsql/tables/llx_user_rights.key.sql @@ -0,0 +1,33 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + +-- Supprimme orhpelins pour permettre montée de la clé +delete llx_user_rights +from llx_user_rights +left join llx_user on llx_user_rights.fk_user = llx_user.rowid +where llx_user.rowid is null; + +ALTER TABLE llx_user_rights ADD FOREIGN KEY (fk_user) REFERENCES llx_user (rowid); diff --git a/pgsql/tables/llx_user_rights.sql b/pgsql/tables/llx_user_rights.sql index df21a1ac96f..883714ad29a 100644 --- a/pgsql/tables/llx_user_rights.sql +++ b/pgsql/tables/llx_user_rights.sql @@ -1,30 +1,34 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =========================================================================== - -create table llx_user_rights -( - fk_user integer NOT NULL, - fk_id integer NOT NULL, - - UNIQUE(fk_user,fk_id) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2003 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + +create table llx_user_rights +( + rowid SERIAL PRIMARY KEY, + "fk_user" integer NOT NULL, + "fk_id" integer NOT NULL +); + diff --git a/pgsql/tables/llx_usergroup.sql b/pgsql/tables/llx_usergroup.sql new file mode 100644 index 00000000000..6d6e82cec84 --- /dev/null +++ b/pgsql/tables/llx_usergroup.sql @@ -0,0 +1,35 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 Rodolphe Quiedeville +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + +create table llx_usergroup +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "tms" timestamp, + "note" text +); diff --git a/pgsql/tables/llx_usergroup_rights.key.sql b/pgsql/tables/llx_usergroup_rights.key.sql new file mode 100644 index 00000000000..80172da61eb --- /dev/null +++ b/pgsql/tables/llx_usergroup_rights.key.sql @@ -0,0 +1,30 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + +-- Supprimme orhpelins pour permettre montée de la clé +DELETE llx_usergroup_rights FROM llx_usergroup_rights LEFT JOIN llx_usergroup ON llx_usergroup_rights.fk_user = llx_usergroup.rowid WHERE llx_usergroup.rowid IS NULL; + +ALTER TABLE llx_usergroup_rights ADD FOREIGN KEY (fk_usergroup) REFERENCES llx_usergroup (rowid); diff --git a/pgsql/tables/llx_usergroup_rights.sql b/pgsql/tables/llx_usergroup_rights.sql new file mode 100644 index 00000000000..983be83aaf2 --- /dev/null +++ b/pgsql/tables/llx_usergroup_rights.sql @@ -0,0 +1,34 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + +create table llx_usergroup_rights +( + rowid SERIAL PRIMARY KEY, + "fk_usergroup" integer NOT NULL, + "fk_id" integer NOT NULL +); + diff --git a/pgsql/tables/llx_usergroup_user.sql b/pgsql/tables/llx_usergroup_user.sql new file mode 100644 index 00000000000..dd8b94faf82 --- /dev/null +++ b/pgsql/tables/llx_usergroup_user.sql @@ -0,0 +1,33 @@ +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- ============================================================================ +-- Copyright (C) 2005 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =========================================================================== + + +create table llx_usergroup_user +( + rowid SERIAL PRIMARY KEY, + "fk_user" integer NOT NULL, + "fk_usergroup" integer NOT NULL +); diff --git a/pgsql/tables/llx_ventes.sql b/pgsql/tables/llx_ventes.sql index dc07344baf2..553f67b8f40 100644 --- a/pgsql/tables/llx_ventes.sql +++ b/pgsql/tables/llx_ventes.sql @@ -1,36 +1,38 @@ --- =================================================================== --- Copyright (C) 2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_ventes -( - rowid SERIAL PRIMARY KEY, - fk_soc integer NOT NULL, - fk_product integer NOT NULL, - dated timestamp without time zone, -- date debut - datef timestamp without time zone, -- date fin - price real, - author varchar(30), - active smallint DEFAULT 0 NOT NULL, - note varchar(255) -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2002 Rodolphe Quiedeville +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- $Source$ +-- +-- =================================================================== + +create table llx_ventes +( + rowid SERIAL PRIMARY KEY, + "fk_soc" integer NOT NULL, + "fk_product" integer NOT NULL, + "dated" datetime, -- date debut + "datef" datetime, -- date fin + "price" real, + "author" varchar(30), + "active" smallint DEFAULT 0 NOT NULL, + "note" varchar(255) +); diff --git a/pgsql/tables/llx_voyage.sql b/pgsql/tables/llx_voyage.sql index abc5a50d45f..e6446cd6fc6 100644 --- a/pgsql/tables/llx_voyage.sql +++ b/pgsql/tables/llx_voyage.sql @@ -1,42 +1,49 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_voyage -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - - dateo date, -- date operation - date_depart timestamp without time zone, -- date du voyage - date_arrivee timestamp without time zone, -- date du voyage - amount real NOT NULL DEFAULT 0, -- prix du billet - reduction real NOT NULL DEFAULT 0, -- montant de la reduction obtenue - depart varchar(255), - arrivee varchar(255), - fk_type smallint, -- Train, Avion, Bateaux - fk_reduc integer, - distance integer, -- distance en kilometre - dossier varchar(50), -- numero de dossier - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- insert into llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc) +-- values ('2002-04-21 12:05','2002-04-21 15:25',26.8,'Paris','Auray',1) + +-- insert into llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc) +-- values ('2002-04-23 15:42','2002-04-23 19:10',26.8,'Auray','Paris',1) +-- =================================================================== + + +create table llx_voyage +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "dateo" date, -- date operation + "date_depart" datetime, -- date du voyage + "date_arrivee" datetime, -- date du voyage + "amount" real NOT NULL DEFAULT 0, -- prix du billet + "reduction" real NOT NULL DEFAULT 0, -- montant de la reduction obtenue + "depart" varchar(255), + "arrivee" varchar(255), + "fk_type" smallint, -- Train, Avion, Bateaux + "fk_reduc" integer, + "distance" integer, -- distance en kilometre + "dossier" varchar(50), -- numero de dossier + "note" text +); diff --git a/pgsql/tables/llx_voyage_reduc.sql b/pgsql/tables/llx_voyage_reduc.sql index 0b90e8845bb..ae23b340640 100644 --- a/pgsql/tables/llx_voyage_reduc.sql +++ b/pgsql/tables/llx_voyage_reduc.sql @@ -1,37 +1,39 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- Copyright (C) 2002-2003 Éric Seigne --- Copyright (C) 2004 Benoit Mortier --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- =================================================================== - -create table llx_voyage_reduc -( - rowid SERIAL PRIMARY KEY, - datec timestamp without time zone, - datev date, -- date de valeur - date_debut date, -- date operation - date_fin date, - amount real NOT NULL DEFAULT 0, - label varchar(255), - numero varchar(255), - fk_type smallint, -- Train, Avion, Bateaux - note text -); +-- Generated from dolibarr_mysql2pgsql +-- (c) 2004, PostgreSQL Inc. +-- (c) 2005, Laurent Destailleur. + +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $Id$ +-- $Source$ +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- =================================================================== + +create table llx_voyage_reduc +( + rowid SERIAL PRIMARY KEY, + "datec" datetime, + "datev" date, -- date de valeur + "date_debut" date, -- date operation + "date_fin" date, + "amount" real NOT NULL DEFAULT 0, + "label" varchar(255), + "numero" varchar(255), + "fk_type" smallint, -- Train, Avion, Bateaux + "note" text +);