- 17 3月, 2019 4 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Before: ``` (16.4ms) TRUNCATE TABLE `author_addresses` (20.5ms) TRUNCATE TABLE `authors` (19.4ms) TRUNCATE TABLE `posts` ``` After: ``` Truncate Tables (19.5ms) TRUNCATE TABLE `author_addresses`; TRUNCATE TABLE `authors`; TRUNCATE TABLE `posts` ```
-
由 Ryuta Kamizono 提交于
This is to easier make `truncate_tables` to bulk statements.
-
- 16 3月, 2019 2 次提交
-
-
由 Josef Šimánek 提交于
-
由 Ryuta Kamizono 提交于
We as Arm Treasure Data are using Optimizer Hints with a monkey patch (https://gist.github.com/kamipo/4c8539f0ce4acf85075cf5a6b0d9712e), especially in order to use `MAX_EXECUTION_TIME` (refer #31129). Example: ```ruby class Job < ApplicationRecord default_scope { optimizer_hints("MAX_EXECUTION_TIME(50000) NO_INDEX_MERGE(jobs)") } end ``` Optimizer Hints is supported not only for MySQL but also for most databases (PostgreSQL on RDS, Oracle, SQL Server, etc), it is really helpful to turn heavy queries for large scale applications.
-
- 14 3月, 2019 1 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit 65f2eeaa.
-
- 13 3月, 2019 7 次提交
-
-
由 Yasuo Honda 提交于
Follow up #35573
-
由 Alex Kitchens 提交于
This commit addresses the issue in https://github.com/rails/rails/issues/35543 by making note of the growing primary key issue with `create_or_find_by`.
-
由 Kasper Timm Hansen 提交于
Useful to not query for indexes when an application uses schema cache. Ref https://github.com/rails/rails/pull/35546
-
由 Kasper Timm Hansen 提交于
Not looking for other contributions like this, but I took the liberty since I was already working on this.
-
由 Kasper Timm Hansen 提交于
YAML has been used to serialize the schema cache ever since 2016 with Rails 5.1: 4c00c6ed
-
由 Ryuta Kamizono 提交于
The `Row` class is no longer used since d956772b.
-
由 Ryuta Kamizono 提交于
Staled `@default_timezone` would cause an error on `reconnect!` after `disconnect!`. https://buildkite.com/rails/rails/builds/59495#23be8079-3a4f-4375-9991-0a6f874554f2 Steps to reproduce: ``` % ARCONN=postgresql bin/test test/cases/adapter_test.rb test/cases/base_test.rb -n "/(?:test_attributes_on_dummy_time|test_reconnect_after_a_disconnect)$/" --seed 15849 Using postgresql Run options: -n "/(?:test_attributes_on_dummy_time|test_reconnect_after_a_disconnect)$/" --seed 15849 # Running: . E Error: ActiveRecord::AdapterTestWithoutTransaction#test_reconnect_after_a_disconnect: NoMethodError: undefined method `add_coder' for #<PG::TypeMapAllStrings:0x00007f85ab9dd5b8> /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:866:in `update_typemap_for_default_timezone' /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:652:in `exec_no_cache' /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:636:in `execute_and_clear' /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:894:in `add_pg_decoders' /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:744:in `connect' /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:285:in `rescue in block in reconnect!' /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:281:in `block in reconnect!' /Users/kamipo/.rbenv/versions/2.6.1/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize' /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:280:in `reconnect!' /Users/kamipo/src/github.com/rails/rails/activerecord/test/cases/adapter_test.rb:465:in `block in <class:AdapterTestWithoutTransaction>' ```
-
- 11 3月, 2019 2 次提交
-
-
由 eileencodes 提交于
* Update RAILS_VERSION * Bundle * rake update_versions * rake changelog:header
-
由 Prathamesh Sonpatki 提交于
Sample example -> Before: prathamesh@Prathameshs-MacBook-Pro-2 blog *$ rails server thin DEPRECATION WARNING: Passing the Rack server name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -u option instead. After: prathamesh@Prathameshs-MacBook-Pro-2 squish_app *$ rails server thin DEPRECATION WARNING: Passing the Rack server name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -u option instead.
-
- 10 3月, 2019 4 次提交
-
-
由 kamille-321 提交于
change the line to check an attribute has user-defined type ref: https://github.com/rails/rails/pull/35320#discussion_r257924552 check query attribute method is working when given value does not respond to to_i method
-
由 Ryuta Kamizono 提交于
It is to work that on `reconnect!` after `disconnect!`. https://buildkite.com/rails/rails/builds/59378#1efea538-cfca-4d43-8b7e-ae78e97227c8
-
由 Ryuta Kamizono 提交于
It is to work that on `reconnect!` after `disconnect!`
-
由 Ryuta Kamizono 提交于
-
- 09 3月, 2019 2 次提交
-
-
由 Sharang Dashputre 提交于
-
由 Vishal Telangre 提交于
-
- 08 3月, 2019 3 次提交
-
-
由 Bob Lail 提交于
Details in https://github.com/rails/rails/issues/35519 In short, MySQL and Sqlite3 allow a record to be both inserted _and_ replaced in the same operation. Postgres (and the SQL-2003 rules for MERGE) do not. Postgres's rationale seems to be that the operation would be nondeterministic. I think it's OK for Rails users to have a different experience with this feature depending on their database; but I think you should be able to follow the examples in the docs on any database.
-
由 François D 提交于
-
由 Patrick Rebsch 提交于
-
- 07 3月, 2019 6 次提交
-
-
由 Ryuta Kamizono 提交于
I've found the skewness of delegation methods between `except` and `only` in a88b6f25. The `only` method is closely similar with `except` as `SpawnMethods`. https://github.com/rails/rails/blob/e056b9bfb07c4eb3bcc6672d885aadd72bec574f/activerecord/lib/active_record/relation/spawn_methods.rb#L53-L67 It is preferable both behaves the same way.
-
由 Ryuta Kamizono 提交于
This makes to ease testing `QUERYING_METHODS`.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 willnet 提交于
-
由 Samantha John 提交于
-
- 06 3月, 2019 7 次提交
-
-
由 Kasper Timm Hansen 提交于
-
由 Kasper Timm Hansen 提交于
-
由 Ryuta Kamizono 提交于
Foreign keys could be created to the same table. So `remove_foreign_key :from_table, :to_table` is sometimes ambiguous. This allows `remove_foreign_key` to remove the select one on the same table with giving both `to_table` and `options`.
-
由 eileencodes 提交于
This change adds a new method that loads the YAML for the database config without parsing the ERB. This may seem odd but bear with me: When we added the ability to have rake tasks for multiple databases we started looping through the configurations to collect the namespaces so we could do `rake db:create:my_second_db`. See #32274. This caused a problem where if you had `Rails.config.max_threads` set in your database.yml it will blow up because the environment that defines `max_threads` isn't loaded during `rake -T`. See #35468. We tried to fix this by adding the ability to just load the YAML and ignore ERB all together but that caused a bug in GitHub's YAML loading where if you used multi-line ERB the YAML was invalid. That led us to reverting some changes in #33748. After trying to resolve this a bunch of ways `@tenderlove` came up with replacing the ERB values so that we don't need to load the environment but we also can load the YAML. This change adds a DummyCompiler for ERB that will replace all the values so we can load the database yaml and create the rake tasks. Nothing else uses this method so it's "safe". DO NOT use this method in your application. Fixes #35468
-
由 Abhay Nikam 提交于
-
由 Ryuta Kamizono 提交于
Since #23461, all adapters supports prepared statements, so that clears the prepared statements cache is no longer database specific. Actually, I struggled to identify the cause of random CI failure in #23461, that was missing `@statements.clear` in `clear_cache!`. This extracts `clear_cache!` to ensure the common concerns in the abstract adapter.
-
由 Bob Lail 提交于
Adds a method to ActiveRecord allowing records to be inserted in bulk without instantiating ActiveRecord models. This method supports options for handling uniqueness violations by skipping duplicate records or overwriting them in an UPSERT operation. ActiveRecord already supports bulk-update and bulk-destroy actions that execute SQL UPDATE and DELETE commands directly. It also supports bulk-read actions through `pluck`. It makes sense for it also to support bulk-creation.
-
- 05 3月, 2019 1 次提交
-
-
由 Bogdan 提交于
* Add `ActiveRecord::Base.connection.truncate` for SQLite3 adapter. SQLite doesn't support `TRUNCATE TABLE`, but SQLite3 adapter can support `ActiveRecord::Base.connection.truncate` by using `DELETE FROM`. `DELETE` without `WHERE` uses "The Truncate Optimization", see https://www.sqlite.org/lang_delete.html. * Add `rails db:seed:replant` that truncates database tables and loads the seeds Closes #34765
-
- 04 3月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
In MySQL, the default collation is case insensitive. Since the uniqueness validator enforces case sensitive comparison by default, it frequently causes mismatched collation issues (performance, weird behavior, etc) to MySQL users. https://grosser.it/2009/12/11/validates_uniqness_of-mysql-slow/ https://github.com/rails/rails/issues/1399 https://github.com/rails/rails/pull/13465 https://github.com/gitlabhq/gitlabhq/commit/c1dddf8c7d947691729f6d64a8ea768b5c915855 https://github.com/huginn/huginn/pull/1330#discussion_r55152573 I'd like to deprecate the implicit default enforcing since I frequently experienced the problems in code reviews. Note that this change has no effect to sqlite3, postgresql, and oracle-enhanced adapters which are implemented as case sensitive by default, only affect to mysql2 adapter (I can take a work if sqlserver adapter will support Rails 6.0).
-