2005-12-07 23:34:26 -05:00
|
|
|
CREATE SEQUENCE public.accounts_id_seq START 100;
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
CREATE TABLE accounts (
|
2007-01-11 23:58:08 -05:00
|
|
|
id integer primary key DEFAULT nextval('public.accounts_id_seq'),
|
2004-11-23 20:04:44 -05:00
|
|
|
firm_id integer,
|
2007-01-11 23:58:08 -05:00
|
|
|
credit_limit integer
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
2006-02-27 23:23:44 -05:00
|
|
|
CREATE TABLE funny_jokes (
|
2006-03-14 20:31:00 -05:00
|
|
|
id serial,
|
2006-02-27 23:23:44 -05:00
|
|
|
name character varying(50)
|
|
|
|
);
|
|
|
|
|
2005-10-15 23:45:39 -04:00
|
|
|
CREATE SEQUENCE companies_nonstd_seq START 101;
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
CREATE TABLE companies (
|
2007-01-11 23:58:08 -05:00
|
|
|
id integer primary key DEFAULT nextval('companies_nonstd_seq'),
|
2004-11-23 20:04:44 -05:00
|
|
|
"type" character varying(50),
|
|
|
|
"ruby_type" character varying(50),
|
|
|
|
firm_id integer,
|
|
|
|
name character varying(50),
|
|
|
|
client_of integer,
|
2007-01-11 23:58:08 -05:00
|
|
|
rating integer default 1
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE developers_projects (
|
|
|
|
developer_id integer NOT NULL,
|
|
|
|
project_id integer NOT NULL,
|
2005-07-18 07:06:41 -04:00
|
|
|
joined_on date,
|
|
|
|
access_level integer default 1
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE developers (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2004-11-23 20:04:44 -05:00
|
|
|
name character varying(100),
|
2004-12-19 06:44:59 -05:00
|
|
|
salary integer DEFAULT 70000,
|
2005-06-18 01:28:59 -04:00
|
|
|
created_at timestamp,
|
2007-01-11 23:58:08 -05:00
|
|
|
updated_at timestamp
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
SELECT setval('developers_id_seq', 100);
|
|
|
|
|
|
|
|
CREATE TABLE projects (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2004-11-23 20:04:44 -05:00
|
|
|
name character varying(100),
|
2007-01-11 23:58:08 -05:00
|
|
|
type varchar(255)
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
SELECT setval('projects_id_seq', 100);
|
|
|
|
|
|
|
|
CREATE TABLE topics (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2004-11-23 20:04:44 -05:00
|
|
|
title character varying(255),
|
|
|
|
author_name character varying(255),
|
|
|
|
author_email_address character varying(255),
|
|
|
|
written_on timestamp without time zone,
|
2004-12-01 08:18:51 -05:00
|
|
|
bonus_time time,
|
2004-11-23 20:04:44 -05:00
|
|
|
last_read date,
|
|
|
|
content text,
|
2005-10-06 00:52:32 -04:00
|
|
|
approved boolean default true,
|
2004-11-23 20:04:44 -05:00
|
|
|
replies_count integer default 0,
|
|
|
|
parent_id integer,
|
2007-01-11 23:58:08 -05:00
|
|
|
"type" character varying(50)
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
SELECT setval('topics_id_seq', 100);
|
|
|
|
|
|
|
|
CREATE TABLE customers (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2004-11-23 20:04:44 -05:00
|
|
|
name character varying,
|
|
|
|
balance integer default 0,
|
|
|
|
address_street character varying,
|
|
|
|
address_city character varying,
|
|
|
|
address_country character varying,
|
2007-01-11 23:58:08 -05:00
|
|
|
gps_location character varying
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
SELECT setval('customers_id_seq', 100);
|
|
|
|
|
2005-08-23 07:05:04 -04:00
|
|
|
CREATE TABLE orders (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2005-08-23 07:05:04 -04:00
|
|
|
name character varying,
|
|
|
|
billing_customer_id integer,
|
2007-01-11 23:58:08 -05:00
|
|
|
shipping_customer_id integer
|
2005-08-23 07:05:04 -04:00
|
|
|
);
|
|
|
|
SELECT setval('orders_id_seq', 100);
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
CREATE TABLE movies (
|
2007-01-11 23:58:08 -05:00
|
|
|
movieid serial primary key,
|
|
|
|
name text
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE subscribers (
|
2007-01-11 23:58:08 -05:00
|
|
|
nick text primary key NOT NULL,
|
|
|
|
name text
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE booleantests (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
|
|
|
value boolean
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE defaults (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2004-11-23 20:04:44 -05:00
|
|
|
modified_date date default CURRENT_DATE,
|
2005-09-27 19:37:57 -04:00
|
|
|
modified_date_function date default now(),
|
2004-11-23 20:04:44 -05:00
|
|
|
fixed_date date default '2004-01-01',
|
|
|
|
modified_time timestamp default CURRENT_TIMESTAMP,
|
2005-09-27 19:37:57 -04:00
|
|
|
modified_time_function timestamp default now(),
|
2004-11-23 20:04:44 -05:00
|
|
|
fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
|
|
|
|
char1 char(1) default 'Y',
|
|
|
|
char2 character varying(50) default 'a varchar field',
|
2006-02-09 13:06:29 -05:00
|
|
|
char3 text default 'a text field',
|
|
|
|
positive_integer integer default 1,
|
2006-07-08 16:35:56 -04:00
|
|
|
negative_integer integer default -1,
|
2007-10-08 02:17:53 -04:00
|
|
|
decimal_number decimal(3,2) default 2.78,
|
2008-02-21 22:26:21 -05:00
|
|
|
multiline_default text DEFAULT '--- []
|
|
|
|
|
|
|
|
'::text
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE auto_id_tests (
|
2007-01-11 23:58:08 -05:00
|
|
|
auto_id serial primary key,
|
|
|
|
value integer
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE entrants (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2006-11-20 03:54:42 -05:00
|
|
|
name text not null,
|
|
|
|
course_id integer not null
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE colnametests (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2004-11-23 20:04:44 -05:00
|
|
|
"references" integer NOT NULL
|
|
|
|
);
|
2004-12-14 19:46:26 -05:00
|
|
|
|
|
|
|
CREATE TABLE mixins (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2004-12-14 19:46:26 -05:00
|
|
|
parent_id integer,
|
2008-01-18 02:29:00 -05:00
|
|
|
type character varying,
|
2004-12-14 19:46:26 -05:00
|
|
|
pos integer,
|
|
|
|
lft integer,
|
|
|
|
rgt integer,
|
2008-01-18 02:29:00 -05:00
|
|
|
root_id integer,
|
2004-12-14 19:46:26 -05:00
|
|
|
created_at timestamp,
|
2007-01-11 23:58:08 -05:00
|
|
|
updated_at timestamp
|
2004-12-14 19:46:26 -05:00
|
|
|
);
|
2004-12-31 14:38:04 -05:00
|
|
|
|
|
|
|
CREATE TABLE people (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2004-12-31 14:38:04 -05:00
|
|
|
first_name text,
|
2007-01-11 23:58:08 -05:00
|
|
|
lock_version integer default 0
|
2005-01-01 13:34:39 -05:00
|
|
|
);
|
|
|
|
|
2006-02-10 00:19:41 -05:00
|
|
|
CREATE TABLE readers (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2006-02-10 00:19:41 -05:00
|
|
|
post_id integer NOT NULL,
|
2007-01-11 23:58:08 -05:00
|
|
|
person_id integer NOT NULL
|
2006-02-10 00:19:41 -05:00
|
|
|
);
|
|
|
|
|
2007-01-11 23:58:08 -05:00
|
|
|
CREATE TABLE binaries (
|
|
|
|
id serial primary key,
|
|
|
|
data bytea
|
2005-01-10 19:24:19 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE computers (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2005-04-30 11:49:28 -04:00
|
|
|
developer integer NOT NULL,
|
2005-06-11 16:26:07 -04:00
|
|
|
"extendedWarranty" integer NOT NULL
|
2005-02-20 16:21:41 -05:00
|
|
|
);
|
|
|
|
|
2005-04-10 11:49:49 -04:00
|
|
|
CREATE TABLE posts (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2005-04-10 11:49:49 -04:00
|
|
|
author_id integer,
|
|
|
|
title varchar(255),
|
|
|
|
type varchar(255),
|
|
|
|
body text
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE comments (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2005-04-10 11:49:49 -04:00
|
|
|
post_id integer,
|
|
|
|
type varchar(255),
|
|
|
|
body text
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE authors (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2005-04-10 11:49:49 -04:00
|
|
|
name varchar(255) default NULL
|
|
|
|
);
|
|
|
|
|
2005-04-18 01:03:56 -04:00
|
|
|
CREATE TABLE tasks (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2005-04-07 02:54:25 -04:00
|
|
|
starting timestamp,
|
2007-01-11 23:58:08 -05:00
|
|
|
ending timestamp
|
2005-04-07 02:54:25 -04:00
|
|
|
);
|
2005-04-10 13:24:56 -04:00
|
|
|
|
|
|
|
CREATE TABLE categories (
|
2007-01-11 23:58:08 -05:00
|
|
|
id serial primary key,
|
2005-07-03 04:21:22 -04:00
|
|
|
name varchar(255),
|
|
|
|
type varchar(255)
|
2005-04-10 13:24:56 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE categories_posts (
|
|
|
|
category_id integer NOT NULL,
|
2005-04-18 01:03:56 -04:00
|
|
|
post_id integer NOT NULL
|
2005-04-10 13:24:56 -04:00
|
|
|
);
|
2005-04-18 03:52:58 -04:00
|
|
|
|
|
|
|
CREATE TABLE fk_test_has_pk (
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE fk_test_has_fk (
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
fk_id INTEGER NOT NULL REFERENCES fk_test_has_fk(id)
|
|
|
|
);
|
2005-10-08 20:52:25 -04:00
|
|
|
|
|
|
|
CREATE TABLE geometrics (
|
|
|
|
id serial primary key,
|
|
|
|
a_point point,
|
|
|
|
-- a_line line, (the line type is currently not implemented in postgresql)
|
|
|
|
a_line_segment lseg,
|
|
|
|
a_box box,
|
|
|
|
a_path path,
|
|
|
|
a_polygon polygon,
|
|
|
|
a_circle circle
|
|
|
|
);
|
2005-10-12 15:55:46 -04:00
|
|
|
|
|
|
|
CREATE TABLE keyboards (
|
|
|
|
key_number serial primary key,
|
|
|
|
"name" character varying(50)
|
|
|
|
);
|
2006-01-14 04:36:52 -05:00
|
|
|
|
|
|
|
--Altered lock_version column name.
|
|
|
|
CREATE TABLE legacy_things (
|
|
|
|
id serial primary key,
|
|
|
|
tps_report_number integer,
|
|
|
|
version integer default 0
|
|
|
|
);
|
2006-07-08 16:35:56 -04:00
|
|
|
|
|
|
|
CREATE TABLE numeric_data (
|
|
|
|
id serial primary key,
|
|
|
|
bank_balance decimal(10,2),
|
|
|
|
big_bank_balance decimal(15,2),
|
|
|
|
world_population decimal(10),
|
|
|
|
my_house_population decimal(2),
|
|
|
|
decimal_number_with_default decimal(3,2) default 2.78
|
|
|
|
);
|
2007-03-08 22:23:37 -05:00
|
|
|
|
|
|
|
CREATE TABLE mixed_case_monkeys (
|
|
|
|
"monkeyID" INTEGER PRIMARY KEY,
|
|
|
|
"fleaCount" INTEGER
|
|
|
|
);
|
2007-08-16 02:26:30 -04:00
|
|
|
|
|
|
|
CREATE TABLE postgresql_arrays (
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
commission_by_quarter INTEGER[],
|
|
|
|
nicknames TEXT[]
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE postgresql_moneys (
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
wealth MONEY
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE postgresql_numbers (
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
single REAL,
|
|
|
|
double DOUBLE PRECISION
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE postgresql_times (
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
time_interval INTERVAL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE postgresql_network_addresses (
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
cidr_address CIDR,
|
|
|
|
inet_address INET,
|
|
|
|
mac_address MACADDR
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE postgresql_bit_strings (
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
bit_string BIT(8),
|
|
|
|
bit_string_varying BIT VARYING(8)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE postgresql_oids (
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
obj_id OID
|
|
|
|
);
|
2007-10-05 20:49:58 -04:00
|
|
|
|
|
|
|
CREATE TABLE minimalistics (
|
|
|
|
id serial primary key
|
|
|
|
);
|