Froze rails gems
[depot.git] / vendor / rails / activerecord / test / schema / postgresql_specific_schema.rb
1 ActiveRecord::Schema.define do
2
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}"
6 end
7
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'
12
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)"
15 end
16
17 execute <<_SQL
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 '--- []
33
34 '::text
35 );
36 _SQL
37
38 execute <<_SQL
39 CREATE TABLE geometrics (
40 id serial primary key,
41 a_point point,
42 -- a_line line, (the line type is currently not implemented in postgresql)
43 a_line_segment lseg,
44 a_box box,
45 a_path path,
46 a_polygon polygon,
47 a_circle circle
48 );
49 _SQL
50
51 execute <<_SQL
52 CREATE TABLE postgresql_arrays (
53 id SERIAL PRIMARY KEY,
54 commission_by_quarter INTEGER[],
55 nicknames TEXT[]
56 );
57 _SQL
58 execute <<_SQL
59 CREATE TABLE postgresql_moneys (
60 id SERIAL PRIMARY KEY,
61 wealth MONEY
62 );
63 _SQL
64
65 execute <<_SQL
66 CREATE TABLE postgresql_numbers (
67 id SERIAL PRIMARY KEY,
68 single REAL,
69 double DOUBLE PRECISION
70 );
71 _SQL
72
73 execute <<_SQL
74 CREATE TABLE postgresql_times (
75 id SERIAL PRIMARY KEY,
76 time_interval INTERVAL
77 );
78 _SQL
79
80 execute <<_SQL
81 CREATE TABLE postgresql_network_addresses (
82 id SERIAL PRIMARY KEY,
83 cidr_address CIDR,
84 inet_address INET,
85 mac_address MACADDR
86 );
87 _SQL
88
89 execute <<_SQL
90 CREATE TABLE postgresql_bit_strings (
91 id SERIAL PRIMARY KEY,
92 bit_string BIT(8),
93 bit_string_varying BIT VARYING(8)
94 );
95 _SQL
96
97 execute <<_SQL
98 CREATE TABLE postgresql_oids (
99 id SERIAL PRIMARY KEY,
100 obj_id OID
101 );
102 _SQL
103 end