提交 963570b5 编写于 作者: R Raimonds Simanovskis

added additional objects necessary for OracleAdapter specific tests

if OracleAdapter is used then use VARCHAR2(4000) instead of CLOB datatype as CLOB data type has many limitations in
Oracle SELECT WHERE clause which causes many unit test failures
上级 04fea8a0
......@@ -2,6 +2,10 @@
execute "drop table test_oracle_defaults" rescue nil
execute "drop sequence test_oracle_defaults_seq" rescue nil
execute "drop sequence companies_nonstd_seq" rescue nil
execute "drop synonym subjects" rescue nil
execute "drop table defaults" rescue nil
execute "drop sequence defaults_seq" rescue nil
execute <<-SQL
create table test_oracle_defaults (
......@@ -16,4 +20,27 @@
create sequence test_oracle_defaults_seq minvalue 10000
SQL
execute "create sequence companies_nonstd_seq minvalue 10000"
execute "create synonym subjects for topics"
execute <<-SQL
CREATE TABLE defaults (
id integer not null,
modified_date date default sysdate,
modified_date_function date default sysdate,
fixed_date date default to_date('2004-01-01', 'YYYY-MM-DD'),
modified_time date default sysdate,
modified_time_function date default sysdate,
fixed_time date default TO_DATE('2004-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'),
char1 varchar2(1) default 'Y',
char2 varchar2(50) default 'a varchar field',
char3 clob default 'a text field',
positive_integer integer default 1,
negative_integer integer default -1,
decimal_number number(3,2) default 2.78
)
SQL
execute "create sequence defaults_seq minvalue 10000"
end
......@@ -104,7 +104,13 @@ def create_table(*args, &block)
create_table :comments, :force => true do |t|
t.integer :post_id, :null => false
t.text :body, :null => false
# use VARCHAR2(4000) instead of CLOB datatype as CLOB data type has many limitations in
# Oracle SELECT WHERE clause which causes many unit test failures
if current_adapter?(:OracleAdapter)
t.string :body, :null => false, :limit => 4000
else
t.text :body, :null => false
end
t.string :type
end
......@@ -350,7 +356,13 @@ def create_table(*args, &block)
create_table :posts, :force => true do |t|
t.integer :author_id
t.string :title, :null => false
t.text :body, :null => false
# use VARCHAR2(4000) instead of CLOB datatype as CLOB data type has many limitations in
# Oracle SELECT WHERE clause which causes many unit test failures
if current_adapter?(:OracleAdapter)
t.string :body, :null => false, :limit => 4000
else
t.text :body, :null => false
end
t.string :type
t.integer :comments_count, :default => 0
t.integer :taggings_count, :default => 0
......@@ -423,7 +435,13 @@ def create_table(*args, &block)
t.datetime :written_on
t.time :bonus_time
t.date :last_read
t.text :content
# use VARCHAR2(4000) instead of CLOB datatype as CLOB data type has many limitations in
# Oracle SELECT WHERE clause which causes many unit test failures
if current_adapter?(:OracleAdapter)
t.string :content, :limit => 4000
else
t.text :content
end
t.boolean :approved, :default => true
t.integer :replies_count, :default => 0
t.integer :parent_id
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册