1 ActiveRecord
::Schema.define
do
3 %w(postgresql_arrays postgresql_moneys postgresql_numbers postgresql_times postgresql_network_addresses postgresql_bit_strings
4 postgresql_oids defaults geometrics
).each
do |table_name
|
5 execute
"DROP TABLE IF EXISTS #{quote_table_name table_name}"
8 execute
'DROP SEQUENCE IF EXISTS companies_nonstd_seq CASCADE'
9 execute
'CREATE SEQUENCE companies_nonstd_seq START 101 OWNED BY companies.id'
10 execute
"ALTER TABLE companies ALTER COLUMN id SET DEFAULT nextval('companies_nonstd_seq')"
11 execute
'DROP SEQUENCE IF EXISTS companies_id_seq'
13 %w(accounts_id_seq developers_id_seq projects_id_seq topics_id_seq customers_id_seq orders_id_seq
).each
do |seq_name
|
14 execute
"SELECT setval('#{seq_name}', 100)"
18 CREATE TABLE defaults (
19 id serial primary key,
20 modified_date date default CURRENT_DATE,
21 modified_date_function date default now(),
22 fixed_date date default '2004-01-01',
23 modified_time timestamp default CURRENT_TIMESTAMP,
24 modified_time_function timestamp default now(),
25 fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
26 char1 char(1) default 'Y',
27 char2 character varying(50) default 'a varchar field',
28 char3 text default 'a text field',
29 positive_integer integer default 1,
30 negative_integer integer default -1,
31 decimal_number decimal(3,2) default 2.78,
32 multiline_default text DEFAULT '--- []
39 CREATE TABLE geometrics (
40 id serial primary key,
42 -- a_line line, (the line type is currently not implemented in postgresql)
52 CREATE TABLE postgresql_arrays (
53 id SERIAL PRIMARY KEY,
54 commission_by_quarter INTEGER[],
59 CREATE TABLE postgresql_moneys (
60 id SERIAL PRIMARY KEY,
66 CREATE TABLE postgresql_numbers (
67 id SERIAL PRIMARY KEY,
69 double DOUBLE PRECISION
74 CREATE TABLE postgresql_times (
75 id SERIAL PRIMARY KEY,
76 time_interval INTERVAL
81 CREATE TABLE postgresql_network_addresses (
82 id SERIAL PRIMARY KEY,
90 CREATE TABLE postgresql_bit_strings (
91 id SERIAL PRIMARY KEY,
93 bit_string_varying BIT VARYING(8)
98 CREATE TABLE postgresql_oids (
99 id SERIAL PRIMARY KEY,