| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If foreign keys specified in create table, generated SQL is slightly more
efficient.
Definition:
```
create_table :testings do |t|
t.references :testing_parent, foreign_key: true
end
```
Before:
```
CREATE TABLE "testings" ("id" serial primary key, "testing_parent_id" integer);
ALTER TABLE "testings" ADD CONSTRAINT "fk_rails_a196c353b2" FOREIGN KEY ("testing_parent_id") REFERENCES "testing_parents" ("id");
```
After:
```
CREATE TABLE "testings" ("id" serial primary key, "testing_parent_id" integer, CONSTRAINT "fk_rails_a196c353b2" FOREIGN KEY ("testing_parent_id") REFERENCES "testing_parents" ("id"));
```
|
|\
| |
| |
| |
| |
| | |
kamipo/eliminate_duplicated_visit_table_definition
Eliminate the duplication code of `visit_TableDefinition`
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
kamipo/eliminate_duplicated_options_include_default_method
Eliminate the duplicated `options_include_default?` method
|
| |/
| |
| |
| | |
Follow up 7ba2cd06.
|
|/
|
|
|
|
|
|
|
| |
Example:
create_table :barcodes, primary_key: ["region", "code"] do |t|
t.string :region
t.integer :code
end
|
|\
| |
| | |
PostgreSQL: `:collation` support for string and text columns
|
| |
| |
| |
| |
| | |
Some databases like MySQL allow defining collation charset for specific
columns.
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
`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.
|
|
|
|
|
|
| |
`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.
|
|
|
|
| |
No need to call `type_to_sql` again.
|
|
|
|
|
| |
The column is no longer used for anything besides type casting, which is
what we're trying to remove from the column entirely.
|
|
|
|
|
|
|
| |
Example:
create_table :foos, id: :bigint do |t|
end
|
| |
|
|\
| |
| | |
Refactor `add_column_options!`, to move the quoting of default value for :uuid in `quote_value`.
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
Method .strip_heredoc is defined in
active_support/core_ext/string/strip.rb so we need to require it.
[fixes #16677]
|
|
|
|
|
|
|
|
| |
The only case where we got a column that was not `nil`, but did not
respond to `cast_type` was when type casting the default value during
schema creation. We can look up the cast type, and add that object to
the column definition. Will allow us to consistently rely on the type
objects for type casting in all directions.
|
| |
|
|
|
|
|
|
| |
The name of the foreign key is not relevant from a users perspective.
Using random names resolves the urge to rename the foreign key when the
respective table or column is renamed.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
fixes #10613
|
|
|
|
| |
It is already called inside type_to_sql method.
|
|
|
|
|
| |
also override drop_table in AbstractMySQLAdapter to properly drop
temporary tables without committing the transaction
|
|
|