diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-05-21 21:22:06 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-21 21:22:06 +0900 |
commit | 054893d574f9c5eebc13d3749680f3a264e4b57d (patch) | |
tree | b2b373d37870f6882d29c7b03e970ac8c83bab5e /activerecord/lib | |
parent | a77447f4da15dd3c2b02563fa6f5769c1d91e1bd (diff) | |
parent | d1a74c1e012ed96f7179e53b9190b7da0a369e11 (diff) | |
download | rails-054893d574f9c5eebc13d3749680f3a264e4b57d.tar.gz rails-054893d574f9c5eebc13d3749680f3a264e4b57d.tar.bz2 rails-054893d574f9c5eebc13d3749680f3a264e4b57d.zip |
Merge pull request #32923 from yahonda/bump_sqlite3_version_to_38
Bump minimum SQLite version to 3.8
Diffstat (limited to 'activerecord/lib')
3 files changed, 12 insertions, 13 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 54dc917e99..199674f531 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -1062,13 +1062,7 @@ module ActiveRecord if (duplicate = inserting.detect { |v| inserting.count(v) > 1 }) raise "Duplicate migration #{duplicate}. Please renumber your migrations to resolve the conflict." end - if supports_multi_insert? - execute insert_versions_sql(inserting) - else - inserting.each do |v| - execute insert_versions_sql(v) - end - end + execute insert_versions_sql(inserting) end end diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 559f068c39..8bdf1712b1 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -137,6 +137,10 @@ module ActiveRecord def <=>(version_string) @version <=> version_string.split(".").map(&:to_i) end + + def to_s + @version.join(".") + end end def valid_type?(type) # :nodoc: @@ -320,6 +324,7 @@ module ActiveRecord def supports_multi_insert? true end + deprecate :supports_multi_insert? # Does this adapter support virtual columns? def supports_virtual_columns? diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index 800e731f06..32e2ed6fc6 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -104,6 +104,10 @@ module ActiveRecord @active = true @statements = StatementPool.new(self.class.type_cast_config_to_integer(config[:statement_limit])) + if sqlite_version < "3.8.0" + raise "Your version of SQLite (#{sqlite_version}) is too old. Active Record supports SQLite >= 3.8." + end + configure_connection end @@ -116,7 +120,7 @@ module ActiveRecord end def supports_partial_index? - sqlite_version >= "3.8.0" + true end def requires_reloading? @@ -124,7 +128,7 @@ module ActiveRecord end def supports_foreign_keys_in_create? - sqlite_version >= "3.6.19" + true end def supports_views? @@ -139,10 +143,6 @@ module ActiveRecord true end - def supports_multi_insert? - sqlite_version >= "3.7.11" - end - def active? @active end |