2 require 'active_record/schema'
4 if ActiveRecord
::Base.connection
.supports_migrations
?
6 class ActiveRecordSchemaTest
< ActiveRecord
::TestCase
7 self.use_transactional_fixtures
= false
10 @connection = ActiveRecord
::Base.connection
14 @connection.drop_table
:fruits rescue nil
17 def test_schema_define
18 ActiveRecord
::Schema.define(:version => 7) do
19 create_table
:fruits do |t
|
20 t
.column
:color, :string
21 t
.column
:fruit_size, :string # NOTE: "size" is reserved in Oracle
22 t
.column
:texture, :string
23 t
.column
:flavor, :string
27 assert_nothing_raised
{ @connection.select_all
"SELECT * FROM fruits" }
28 assert_nothing_raised
{ @connection.select_all
"SELECT * FROM schema_migrations" }
29 assert_equal
7, ActiveRecord
::Migrator::current_version