diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-10-15 17:31:56 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-10-15 17:32:10 -0700 |
commit | 574234be067f0f000a945560cabcabb68c8a1ec9 (patch) | |
tree | 183009ff6aed8db428e3b9a400b5058f4bc94ff9 /activerecord/test | |
parent | e01f1b3406057d48ee2742a80e909821cb8e5d43 (diff) | |
download | rails-574234be067f0f000a945560cabcabb68c8a1ec9.tar.gz rails-574234be067f0f000a945560cabcabb68c8a1ec9.tar.bz2 rails-574234be067f0f000a945560cabcabb68c8a1ec9.zip |
add table.bigint support
In the DSL you can now do:
create_table(:foos) do |t|
t.bigint :hi
end
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migration/change_schema_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/change_schema_test.rb b/activerecord/test/cases/migration/change_schema_test.rb index bd3dd29f4d..d91e7142b3 100644 --- a/activerecord/test/cases/migration/change_schema_test.rb +++ b/activerecord/test/cases/migration/change_schema_test.rb @@ -97,6 +97,25 @@ module ActiveRecord end end + def test_create_table_with_bigint + connection.create_table :testings do |t| + t.bigint :eight_int + end + columns = connection.columns(:testings) + eight = columns.detect { |c| c.name == "eight_int" } + + if current_adapter?(:OracleAdapter) + assert_equal 'NUMBER(8)', eight.sql_type + elsif current_adapter?(:SQLite3Adapter) + assert_equal 'bigint', eight.sql_type + else + assert_equal :integer, eight.type + assert_equal 8, eight.limit + end + ensure + connection.drop_table :testings + end + def test_create_table_with_limits connection.create_table :testings do |t| t.column :foo, :string, :limit => 255 |