| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
|\
| |
| | |
Revert passing arel node with splat binds for `where`
|
| |
| |
| |
| |
| | |
A `value` is only used for checking `value.nil?`. It is unnecessary if
immediately return when `value.nil?`.
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
| |
|
|\
| |
| |
| |
| |
| | |
Introduce new ActiveRecord transaction error classes
Closes #26018
|
| | |
|
|\ \
| | |
| | | |
Prevent `table_comment` query if a table doesn't have a comment
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
`current_database` executes a query and `table_comment` is called to all
tables even if a table does not have a comment. Using `current_database`
increases extra queries.
|
| | |
| | |
| | | |
[Rafael Mendonça França + Takeshi AKIMA]
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Where appropriatei, prefer the more concise Regexp#match?,
String#include?, String#start_with?, or String#end_with?
|
| | |
| | |
| | |
| | |
| | |
| | | |
`create_table_info_cache` is used for sharing `create_table_info` both
`table_options` and `foreign_keys`. But `foreign_keys` no longer uses
`create_table_info_cache` by #25307. No need caching anymore.
|
| | |
| | |
| | |
| | | |
Fixes #25300.
|
|/ / |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow up of #20815.
```ruby
class CreatePeople < ActiveRecord::Migration[5.0]
def change
create_table :people do |t|
t.integer :int
t.bigint :bint
t.text :txt
t.binary :bin
end
end
end
```
Result.
In postgresql and sqlite3 adapters:
```ruby
ActiveRecord::Schema.define(version: 20160531141018) do
create_table "people", force: :cascade do |t|
t.integer "int"
t.bigint "bint"
t.text "txt"
t.binary "bin"
end
end
```
In mysql2 adapter:
```ruby
ActiveRecord::Schema.define(version: 20160531141018) do
create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
t.integer "int"
t.bigint "bint"
t.text "txt", limit: 65535
t.binary "bin", limit: 65535
end
end
```
After this patch:
```ruby
ActiveRecord::Schema.define(version: 20160531141018) do
create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
t.integer "int"
t.bigint "bint"
t.text "txt"
t.binary "bin"
end
end
```
|
|
|
|
| |
or deadlocks
|
|
|
|
|
|
|
|
| |
Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005
* Forward compat with new unified Integer class in Ruby 2.4+.
* Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3.
* Drops needless Fixnum distinction in docs, preferring Integer.
|
| |
|
|
|
|
|
|
|
| |
`schema_creation` is not public API.
https://github.com/rails/rails/blob/v5.0.0.beta4/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L121
https://github.com/rails/rails/blob/v5.0.0.beta4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L78
|
|
|
|
|
|
| |
Refactor of #22911.
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
|
|
|
|
|
|
|
|
| |
- Rename max to statement_limit
- Remove magic number 1000 from everywhere
- Defined StatementPool::DEFAULT_STATEMENT_LIMIT and started using it everywhere
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
|
|
|
|
|
| |
Adapters override `#supports_savepoints?` to return `true` if they
support transaction savepoints. Defaults to `false`.
|
|\
| |
| |
| | |
Add prepared statements support for `Mysql2Adapter`
|
|/ |
|
|
|
|
| |
`Arel::Visitors::VISITORS` was removed at https://github.com/rails/arel/pull/412.
|
|\
| |
| |
| | |
Extract `extract_schema_qualified_name` method
|
| | |
|
|\ \
| | |
| | |
| | | |
Extract `arel_visitor` and move up to the abstract adapter
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | | |
Add `ActiveRecord::ValueTooLong` exception class
|
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | | |
* Switch to keyword args where we can without breaking compat.
* Use add_table_options! for :options, too.
* Some code polish.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Comments are specified in migrations, stored in database itself (in its schema),
and dumped into db/schema.rb file.
This allows to generate good documentation and explain columns and tables' purpose
to everyone from new developers to database administrators.
For PostgreSQL and MySQL only. SQLite does not support comments at the moment.
See docs for PostgreSQL: http://www.postgresql.org/docs/current/static/sql-comment.html
See docs for MySQL: http://dev.mysql.com/doc/refman/5.7/en/create-table.html
|
|\ \ \
| | | |
| | | | |
Test against MariaDB 10.0
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- Specify we want to run on latest stable ruby for mariadb
- change in runs of builds
Make mariadb? method publicly available
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reason:
- Its not publicly used method.
- Exposing it makes an assumption that other adapters support it based on its usage - ActiveRecord::Base.connection.version
[ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We support microsecond datetime precision for MySQL 5.6.4+. MariaDB has
supported it since 5.3.0, but even 10.x versions return a compatible
version string like `5.5.5-10.1.8-MariaDB-log` which we parse as 5.5.5,
before MySQL supported microsecond precision.
Specialize our version check to account for MariaDB to fix.
|
|\ \ \
| | | |
| | | | |
Simply use `select_value` in `show_variable`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`SELECT @@name` statement returns only single row or `StatementInvalid`.
```
root@localhost [activerecord_unittest] > SELECT @@version;
+-----------+
| @@version |
+-----------+
| 5.7.9-log |
+-----------+
1 row in set (0.00 sec)
root@localhost [activerecord_unittest] > SELECT @@unknown_variable;
ERROR 1193 (HY000): Unknown system variable 'missing_variable'
```
|
|\ \ \ \
| | | | |
| | | | | |
Move quoting methods to `Quoting` module
|
| | | | |
| | | | |
| | | | |
| | | | | |
`MysqlString`
|
| | | | |
| | | | |
| | | | |
| | | | | |
methods to `Quoting` module
|
| | | | | |
|
|/ / / /
| | | |
| | | | |
The hard-coded back-ticks made it hard to use a different char for quoting db fields. This checkin replaces it with quote_table_name.
|
| |_|/
|/| |
| | |
| | |
| | |
| | | |
Because we define `QUOTED_TRUE` as `"1"` and `QUOTED_FALSE` as `"0"`.
And add test cases to ensure this commit does not break current
behavior even if the value of `attributes_before_type_cast` is false.
|