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