| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Related #28399.
|
|
|
|
| |
Since 1a92ae83 all `indexes` methods are under the `SchemaStatements`.
|
|
|
|
|
|
|
| |
MySQL 8.0.1 and higher supports descending indexes: `DESC` in an index
definition is no longer ignored.
See https://dev.mysql.com/doc/refman/8.0/en/descending-indexes.html.
|
|
|
|
|
|
|
| |
* Use keyword arguments in `IndexDefinition` to ease to ignore unused
options and to avoid to initialize incorrect empty value.
* Place it in `SchemaStatements` for consistency.
* And tiny tweaks.
|
|\
| |
| | |
Add comprehensive locking around DB transactions
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Transactional-fixture using tests with racing threads and inter-thread
synchronisation inside transaction blocks will now deadlock... but
without this, they would just crash.
In 5.0, the threads didn't share a connection at all, so it would've
worked... but with the main thread inside the fixture transaction, they
wouldn't've been able to see each other.
So: as far as I can tell, the set of operations this "breaks" never had
a compelling use case. Meanwhile, it provides an increased level of
coherency to the operational feel of transactional fixtures.
If this does cause anyone problems, they're probably best off disabling
transactional fixtures on the affected tests, and managing transactions
themselves.
|
|/
|
|
|
|
| |
Also, explicitly apply the order: generate_subscripts is unlikely to
start returning values out of order, but we should still be clear about
what we want.
|
|
|
| |
`ActiveRecord::Base.establish_connection` accepts a single symbol argument to specify a named connection; a single string argument appears to be interpreted as a connection URI
|
|\
| |
| | |
Fix `primary_keys` across multiple schemas
|
| |
| |
| |
| | |
Fixes #28470.
|
|\ \
| | |
| | | |
Make internal methods to private
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
privileges (take 2)
Re-create https://github.com/rails/rails/pull/21233
eeac6151a5 was reverted (127509c071b4) because it breaks tests.
----------------
ref: 72c1557254
- We must use `authors` fixture with `author_addresses` because of its foreign key constraint.
- Tests require PostgreSQL >= 9.4.2 because it had a bug about `ALTER CONSTRAINTS` and fixed in 9.4.2.
|
| |
| |
| |
| |
| |
| | |
Because this comment is not document for `supports_ranges?`
ref: https://github.com/rails/rails/pull/27636#discussion_r107560081
|
|\ \
| | |
| | | |
Fix `LogSubscriber` to allow legacy `binds`
|
| | |
| | |
| | |
| | | |
Follow up of #27939.
|
|/ /
| |
| |
| |
| | |
The old top level classes PGconn, PGresult and PGError were deprecated
since pg-0.13.0: https://github.com/ged/ruby-pg/blob/master/History.rdoc#v0130-2012-02-09-michael-granger-gedfaeriemudorg
|
|\ \
| | |
| | | |
Remove duplicated `columns` definition
|
| |/ |
|
|\ \
| |/
|/| |
Fix `select_all` with legacy `binds`
|
| |
| |
| |
| | |
Fixes #27923.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
mylake/reduce-postgresql-adapter-memory-bloat"
This reverts commit 192db64452d148c7b51713979459e38407380dc6, reversing
changes made to 9893955363cf6358556ed3b36f4538d5b54e9d17.
We can't sacrifice correctness for performance.
|
|\ \
| | |
| | | |
500x memory reduction of 10k schemas for postgresql adapter
|
| | |
| | |
| | |
| | | |
bloat especially in multi-schema structure database
|
|\ \ \
| | | |
| | | | |
Extract `data_source_sql` to refactor data source statements
|
| | | | |
|
| | | | |
|
|\ \ \ \
| |_|/ /
|/| | | |
Suppress deprecation warning `implementing to_yaml is deprecated`
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
Extract `SchemaMigration.all_versions`
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Use `SchemaMigration.all_versions` instead of
`SchemaMigration.all.map(&:version)` to avoid to instantiate AR objects.
|
|/ / /
| | |
| | |
| | | |
Fixes #28285.
|
| | |
| | |
| | |
| | | |
Simply use `SchemaMigration.table_name` instead.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Related #25174.
`db:schema:load` doesn't work with subdirectories like previous
`db:migrate:status`. `Migrator.migration_files` should be used in
`assume_migrated_upto_version` to fix the issue.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Sharing `options` causes some unexpected behavior. If `limit: 2` is
specified, this means that 2 bytes integer for a reference id column and
2 chars string for a reference type column. Another example, if
`unsigned: true` is specified, this means that unsigned integer for a
reference id column, but a invalid option for a reference type column.
So `options` should not be shared with a reference type column.
|
|\ \ \
| | | |
| | | | |
`valid_type?` should accept only supported types
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`valid_type?` is used in schema dumper to determine if a type is
supported. So if `valid_type?(:foobar)` is true, it means that schema
dumper is allowed to create `t.foobar`. But it doesn't work. I think
that `valid_type?` should accept only supported types.
https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/lib/active_record/schema_dumper.rb#L135-L142
```ruby
columns.each do |column|
raise StandardError, "Unknown type '#{column.sql_type}' for column '#{column.name}'" unless @connection.valid_type?(column.type)
next if column.name == pk
type, colspec = @connection.column_spec(column)
tbl.print " t.#{type} #{column.name.inspect}"
tbl.print ", #{format_colspec(colspec)}" if colspec.present?
tbl.puts
end
```
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Follow up of #26266.
The default type of `primary_key` and `references` were changed to
`bigint` since #26266. But `create_join_table` column type is still
`integer`. It should respect `references` column type.
|
| | |
| | |
| | |
| | |
| | | |
Actually `index_name_length` depend on `max_identifier_length`, not
always 63.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`supports_migrations?` was added at 4160b518 to determine if schema
statements (`create_table`, `drop_table`, etc) are implemented in the
adapter. But all tested databases has been supported migrations since
a4fc93c3 at least.
|
|\ \ \
| | | |
| | | | |
Push `valid_type?` up to abstract adapter
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`valid_type?` should return true if a type exists in
`native_database_types` at least.
https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/lib/active_record/schema_dumper.rb#L136
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently `change_column` cannot drop default if `null: false` is
specified at the same time. This change fixes the issue.
```ruby
# cannot drop default
change_column "tests", "contributor", :boolean, default: nil, null: false
# we need the following workaround currently
change_column "tests", "contributor", :boolean, null: false
change_column "tests", "contributor", :boolean, default: nil
```
Closes #26582
|
|\ \ \
| | | |
| | | | |
Deprecate AbstractAdapter#verify! with arguments
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
kamipo/fix_remove_reference_to_multiple_foreign_keys_in_the_same_table
Fix `remove_reference` to multiple foreign keys in the same table
|
| | |_|/
| |/| | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Originally `quoted_id` was used in legacy quoting mechanism. Now we use
type casting mechanism for that. Let's deprecate `quoted_id`.
|