- 17 12月, 2015 1 次提交
-
-
由 Grey Baker 提交于
Support passing the schema name as a prefix to table name in `ConnectionAdapters::SchemaStatements#indexes`. Previously the prefix would be considered a full part of the index name, and only the schema in the current search path would be considered.
-
- 09 11月, 2015 1 次提交
-
-
由 yui-knk 提交于
Reported on #21509, how views is treated by `#tables` are differ by each adapters. To fix this different behavior, after Rails 5.0 is released, deprecate `#tables`. And `#table_exists?` would check both tables and views. To make their behavior consistent with `#tables`, after Rails 5.0 is released, deprecate `#table_exists?`.
-
- 23 9月, 2015 1 次提交
-
-
由 Yves Senn 提交于
These new methods are used from the Active Record model layer to determine which relations are viable to back a model. These new methods allow us to change `conn.tables` in the future to only return tables and no views. Same for `conn.table_exists?`. The goal is to provide the following introspection methods on the connection: * `tables` * `table_exists?` * `views` * `view_exists?` * `data_sources` (views + tables) * `data_source_exists?` (views + tables)
-
- 20 9月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
Example: create_table :barcodes, primary_key: ["region", "code"] do |t| t.string :region t.integer :code end
-
- 13 9月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 06 9月, 2015 2 次提交
-
-
由 Matthew Draper 提交于
Apparently I managed to forget how similar the "tests passing" and "no status reported" merge indicators look. Note that the previous `stubs` in test_add_index wasn't working: the method was still called, and just happened to return false.
-
由 Grey Baker 提交于
See http://www.postgresql.org/docs/9.4/static/sql-dropindex.html for more details.
-
- 28 8月, 2015 3 次提交
-
-
由 Yves Senn 提交于
Closes #21418. Previously schema names were not quoted. This leads to issues when a schema names contains a ".". Methods in `schema_statements.rb` should quote user input.
-
由 Yves Senn 提交于
[ci skip] Currently the `#tables` method does not make use of the `name` argument and always returns all the tables in the schema search path. However the docs suggest different behavior. While we should porbably adjust the implementation to provide this behavior, let's make the docs right for now (also for `4-2-stable`) and then implement the behavior on `master`.
-
由 Yves Senn 提交于
-
- 27 6月, 2015 1 次提交
-
-
由 Prem Sichanugrist 提交于
Passing `:from` and `:to` to `change_column_default` makes this command reversible as user has defined its previous state. So, instead of having the migration command as: change_column_default(:posts, :state, "draft") They can write it as: change_column_default(:posts, :state, from: nil, to: "draft")
-
- 20 5月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
Related with #20028.
-
- 13 5月, 2015 1 次提交
-
-
由 Tony Miller 提交于
-
- 08 5月, 2015 1 次提交
-
-
由 Tony Miller 提交于
Its already doc'ed in activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
-
- 05 5月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
`exec_query` create `ActiveRecord::Result` instance. It is better to use `select_value` instead of `exec_query` for performance.
-
- 04 5月, 2015 2 次提交
-
-
由 Ryuta Kamizono 提交于
Example: create_table :foos do |t| t.string :string_en, collation: 'en_US.UTF-8' t.text :text_ja, collation: 'ja_JP.UTF-8' end
-
由 Ryuta Kamizono 提交于
Some databases like MySQL allow defining collation charset for specific columns.
-
- 03 5月, 2015 2 次提交
-
-
由 Tony Miller 提交于
Its nodoc'ed for the other implementations, and doc'ed in the base class, just like the other change_column* methods.
-
由 Tony Miller 提交于
`change_column_null` is doc'ed only in ActiveRecord::ConnectionAdapters::SchemaStatements, so it would make sense to :nodoc: it elsewhere.
-
- 30 4月, 2015 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
- Added documentation for index_name_exists? and rename_index. - Also changed rails to \Rails in documentation of allowed_index_name_length.
-
- 07 4月, 2015 2 次提交
-
-
由 Rafael Mendonça França 提交于
It behaves in the same way that the abstract adapter. [ci skip]
-
由 Mehmet Emin İNAÇ 提交于
-
- 06 4月, 2015 1 次提交
-
-
由 Mehmet Emin İNAÇ 提交于
-
- 01 4月, 2015 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 25 3月, 2015 1 次提交
-
-
由 Lars Kanis 提交于
The type map was introduced in aafee233, but wasn't properly filled. This mainly adjusts many locations, that expected strings instead of integers or boolean. add_pg_decoders is moved after setup of the StatementPool, because execute_and_clear could potentially make use of it.
-
- 03 3月, 2015 1 次提交
-
-
由 Juanito Fatas 提交于
-
- 20 2月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 19 2月, 2015 2 次提交
-
-
由 Ryuta Kamizono 提交于
`[]` is a part of `sql_type`, so it is always necessary to respect to array option when `type_to_sql` is called.
-
由 Ryuta Kamizono 提交于
-
- 18 2月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
This reverts commit 1502caef. The test suite for the mysql adapter broke when this commit was used with MySQL 5.6. Conflicts: activerecord/CHANGELOG.md
-
- 12 2月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 11 2月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
`quote_default_expression` and `quote_default_value` are almost the same handling for do not quote default function of `:uuid` columns. Rename `quote_default_value` to `quote_default_expression`, and remove duplicate code.
-
- 08 2月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
`sql_type` is reused in `lookup_cast_type`. If making it a part of `sql_type` when handled array option first, it isn't necessary to do again.
-
- 04 2月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
The type from the column is never used, except when being passed to the attributes API. While leaving the type on the column wasn't necessarily a bad thing, I worry that it's existence there implies that it is something which should be used. During the design and implementation process of the attributes API, there have been plenty of cases where getting the "right" type object was hard, but I had easy access to the column objects. For any contributor who isn't intimately familiar with the intents behind the type casting system, grabbing the type from the column might easily seem like the "correct" thing to do. As such, the goal of this change is to express that the column is not something that should be used for type casting. The only places that are "valid" (at the time of this commit) uses of acquiring a type object from the column are fixtures (as the YAML file is going to mirror the database more closely than the AR object), and looking up the type during schema detection to pass to the attributes API Many of the failing tests were removed, as they've been made obsolete over the last year. All of the PG column tests were testing nothing beyond polymorphism. The Mysql2 tests were duplicating the mysql tests, since they now share a column class. The implementation is a little hairy, and slightly verbose, but it felt preferable to going back to 20 constructor options for the columns. If you are git blaming to figure out wtf I was thinking with them, and have a better idea, go for it. Just don't use a type object for this.
-
- 31 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
The goal is to remove the type object from the column, and remove columns from the type casting process entirely. The primary motivation for this is clarity. The connection adapter does not have sufficient type information, since the type we want to work with might have been overriden at the class level. By taking this object from the column, it is easy to mistakenly think that the column object which exists on the connection adapter is sufficient. It isn't. A concrete example of this is `serialize`. In 4.2 and earlier, `where` worked in a very inconsistent and confusing manner. If you passed a single value to `where`, it would serialize it before querying, and do the right thing. However, passing it as part of an array, hash, or range would cause it to not work. This is because it would stop using prepared statements, so the type casting would come from arel. Arel would have no choice but to get the column from the connection adapter, which would treat it as any other string column, and query for the wrong value. There are a handful of cases where using the column object to find the cast type is appropriate. These are cases where there is not actually a class involved, such as the migration DSL, or fixtures. For all other cases, the API should be designed as such that the type is provided before we get to the connection adapter. (For an example of this, see the work done to decorate the arel table object with a type caster, or the introduction of `QueryAttribute` to `Relation`). There are times that it is appropriate to use information from the column to change behavior in the connection adapter. These cases are when the primitive used to represent that type before it goes to the database does not sufficiently express what needs to happen. An example of this that affects every adapter is binary vs varchar, where the primitive used for both is a string. In this case it is appropriate to look at the column object to determine which quoting method to use, as this is something schema dependent. An example of something which would not be appropriate is to look at the type and see that it is a datetime, and performing string parsing when given a string instead of a date. This is the type of logic that should live entirely on the type. The value which comes out of the type should be a sufficiently generic primitive that the adapter can be expected to know how to work with it. The one place that is still using the column for type information which should not be necessary is the connection adapter type caster which is sometimes given to the arel table when we can't find the associated table. This will hopefully go away in the near future.
-
- 19 1月, 2015 1 次提交
-
-
由 Stefan Kanev 提交于
If set to `if_exists: true`, it generates a statement like: DROP TABLE IF EXISTS posts This syntax is supported in the popular SQL servers, that is (at least) SQLite, PostgreSQL, MySQL, Oracle and MS SQL Sever. Closes #16366.
-
- 31 12月, 2014 2 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Arthur Neves 提交于
When table has a composite primary key, the `primary_key` method for sqlite3 and postgresql was only returning the first field of the key. Ensures that it will return nil instead, as AR dont support composite pks.
-
- 28 12月, 2014 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 19 12月, 2014 1 次提交
-
-
由 Yves Senn 提交于
-