[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2666] trunk/sql/Pg-database.sql
- Subject: SF.net SVN: ledger-smb:[2666] trunk/sql/Pg-database.sql
- From: ..hidden..
- Date: Fri, 12 Jun 2009 20:10:38 +0000
Revision: 2666
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2666&view=rev
Author: einhverfr
Date: 2009-06-12 20:10:38 +0000 (Fri, 12 Jun 2009)
Log Message:
-----------
Moving country table up to avoid conflicts
Modified Paths:
--------------
trunk/sql/Pg-database.sql
Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql 2009-06-12 19:32:22 UTC (rev 2665)
+++ trunk/sql/Pg-database.sql 2009-06-12 20:10:38 UTC (rev 2666)
@@ -46,10 +46,21 @@
pricegroup text
);
+CREATE TABLE country (
+ id serial PRIMARY KEY,
+ name text check (name ~ '[[:alnum:]_]') NOT NULL,
+ short_name text check (short_name ~ '[[:alnum:]_]') NOT NULL,
+ itu text);
+
+COMMENT ON COLUMN country.itu IS $$ The ITU Telecommunication Standardization Sector code for calling internationally. For example, the US is 1, Great Britain is 44 $$;
+
+CREATE UNIQUE INDEX country_name_idx on country(lower(name));
+
-- BEGIN new entity management
CREATE TABLE entity_class (
id serial primary key,
class text check (class ~ '[[:alnum:]_]') NOT NULL,
+ country_id int references country(id),
active boolean not null default TRUE);
COMMENT ON TABLE entity_class IS $$ Defines the class type such as vendor, customer, contact, employee $$;
@@ -152,17 +163,7 @@
batch work flows. $$;
-- LOCATION AND COUNTRY
-CREATE TABLE country (
- id serial PRIMARY KEY,
- name text check (name ~ '[[:alnum:]_]') NOT NULL,
- short_name text check (short_name ~ '[[:alnum:]_]') NOT NULL,
- itu text);
-
-COMMENT ON COLUMN country.itu IS $$ The ITU Telecommunication Standardization Sector code for calling internationally. For example, the US is 1, Great Britain is 44 $$;
-CREATE UNIQUE INDEX country_name_idx on country(lower(name));
-
-
create table country_tax_form ( country_id int references country(id) not null,
form_name text not null,
id serial not null unique,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.