[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4045] branches/1.3/sql/Pg-database.sql



Revision: 4045
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4045&view=rev
Author:   tshvr
Date:     2011-11-24 10:04:06 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
entity_credit_account referential constraint on language_code,remove spaces,typo error

Modified Paths:
--------------
    branches/1.3/sql/Pg-database.sql

Modified: branches/1.3/sql/Pg-database.sql
===================================================================
--- branches/1.3/sql/Pg-database.sql	2011-11-24 09:32:19 UTC (rev 4044)
+++ branches/1.3/sql/Pg-database.sql	2011-11-24 10:04:06 UTC (rev 4045)
@@ -135,6 +135,54 @@
 COMMENT ON TABLE pricegroup IS
 $$ Pricegroups are groups of customers who are assigned prices and discounts
 together.$$;
+--TABLE language moved here because of later references
+CREATE TABLE language (
+  code varchar(6) PRIMARY KEY,
+  description text
+);
+COMMENT ON TABLE language IS
+$$ Languages for manual translations and so forth.$$;
+INSERT INTO language (code, description)
+VALUES ('ar_EG', 'Arabic (Egypt)'),
+       ('bg',    'Bulgarian'), 
+       ('ca',    'Catalan'),
+       ('cs',    'Czech'),
+       ('da',    'Danish'),
+       ('de',    'German'),
+       ('de_CH', 'German (Switzerland)'),
+       ('el',    'Greek'),
+       ('en',    'English'),
+       ('en_US', 'English (US)'),
+       ('en_GB', 'English (UK)'),
+       ('es',    'Spanish'),
+       ('es_CO', 'Spanish (Colombia)'),
+       ('es_EC', 'Spanish (Ecuador)'),
+       ('es_MX', 'Spanish (Mexico)'),
+       ('es_PA', 'Spanish (Panama)'),
+       ('es_PY', 'Spanish (Paraguay)'),
+       ('es_VE', 'Spanish (Venezuela)'),
+       ('et',    'Estonian'),
+       ('fi',    'Finnish'),
+       ('fr',    'French'),
+       ('fr_BE', 'French (Belgium)'),
+       ('fr_CA', 'French (Canada)'),
+       ('hu',    'Hungarian'),
+       ('id',    'Indonesian'),
+       ('is',    'Icelandic'),
+       ('it',    'Italian'),
+       ('lt',    'Latvian'),
+       ('nb',    'Norwegian'),
+       ('nl',    'Dutch'),
+       ('nl_BE', 'Dutch (Belgium)'),
+       ('pl',    'Polish'),
+       ('pt',    'Portuguese'),
+       ('pt_BR', 'Portuguese (Brazil)'),
+       ('ru',    'Russian'),
+       ('sv',    'Swedish'),
+       ('tr',    'Turkish'),
+       ('uk',    'Ukranian'),
+       ('zh_CN', 'Chinese (China)'),
+       ('zh_TW', 'Chinese (Taiwan)');
 -- country and tax form
 
 CREATE TABLE country (
@@ -402,7 +450,7 @@
 
 
 
-create table country_tax_form (                                                    country_id int references country(id) not null,
+create table country_tax_form (country_id int  references country(id) not null,
    form_name text not null,
    id serial not null unique,
    default_reportable bool not null default false,
@@ -795,7 +843,7 @@
     terms int2 default 0,
     meta_number varchar(32),
     business_id int,
-    language_code varchar(6),
+    language_code varchar(6) DEFAULT 'en' references language(code) ON DELETE SET DEFAULT,
     pricegroup_id int references pricegroup(id),
     curr char(3),
     startdate date DEFAULT CURRENT_DATE,
@@ -812,7 +860,7 @@
 );
 
 COMMENT ON TABLE entity_credit_account IS
-$$This table stores informmation relating to general relationships regarding 
+$$This table stores information relating to general relationships regarding 
 moneys owed on invoice.  Invoices, whether AR or AP, must be attached to 
 a record in this table.$$;
 
@@ -1649,56 +1697,6 @@
 $$ Tracks per-customer pricing.  Discounts can be offered for periods of time
 and for pricegroups as well as per customer$$;
 --
-CREATE TABLE language (
-  code varchar(6) PRIMARY KEY,
-  description text
-);
-
-COMMENT ON TABLE language IS
-$$ Languages for manual translations and so forth.$$;
-
-INSERT INTO language (code, description)
-VALUES ('ar_EG', 'Arabic (Egypt)'),
-       ('bg',    'Bulgarian'), 
-       ('ca',    'Catalan'),
-       ('cs',    'Czech'),
-       ('da',    'Danish'),
-       ('de',    'German'),
-       ('de_CH', 'German (Switzerland)'),
-       ('el',    'Greek'),
-       ('en',    'English'),
-       ('en_US', 'English (US)'),
-       ('en_GB', 'English (UK)'),
-       ('es',    'Spanish'),
-       ('es_CO', 'Spanish (Colombia)'),
-       ('es_EC', 'Spanish (Ecuador)'),
-       ('es_MX', 'Spanish (Mexico)'),
-       ('es_PA', 'Spanish (Panama)'),
-       ('es_PY', 'Spanish (Paraguay)'),
-       ('es_VE', 'Spanish (Venezuela)'),
-       ('et',    'Estonian'),
-       ('fi',    'Finnish'),
-       ('fr',    'French'),
-       ('fr_BE', 'French (Belgium)'),
-       ('fr_CA', 'French (Canada)'),
-       ('hu',    'Hungarian'),
-       ('id',    'Indonesian'),
-       ('is',    'Icelandic'),
-       ('it',    'Italian'),
-       ('lt',    'Latvian'),
-       ('nb',    'Norwegian'),
-       ('nl',    'Dutch'),
-       ('nl_BE', 'Dutch (Belgium)'),
-       ('pl',    'Polish'),
-       ('pt',    'Portuguese'),
-       ('pt_BR', 'Portuguese (Brazil)'),
-       ('ru',    'Russian'),
-       ('sv',    'Swedish'),
-       ('tr',    'Turkish'),
-       ('uk',    'Ukranian'),
-       ('zh_CN', 'Chinese (China)'),
-       ('zh_TW', 'Chinese (Taiwan)');
-
 --
 CREATE TABLE audittrail (
   trans_id int,

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.