| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While running Sqlite3 memory tests I encountered the following error:
```
Finished in 69.416366s, 58.0267 runs/s, 162.3681 assertions/s.
1) Error:
ActiveRecord::Migration::ChangeSchemaTest#test_add_column_with_timestamp_type:
NoMethodError: undefined method `type' for nil:NilClass
/Users/senny/Projects/rails/activerecord/test/cases/migration/change_schema_test.rb:244:in `test_add_column_with_timestamp_type'
4028 runs, 11271 assertions, 0 failures, 1 errors, 1 skips
```
This was because the table `testings` was used in multiple test-cases.
This resulted in a wrongly cached schema on `ActiveRecord::Base.schema_chae`.
/cc @zuhao
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `:timestamp` type for columns is unused. All database adapters treat
them as the same database type. All code in `ActiveRecord` which changes
its behavior based on the column's type acts the same in both cases.
However, when the type is passed to code that checks for the `:datetime`
type, but not `:timestamp` (such as XML serialization), the result is
unexpected behavior.
Existing schema definitions will continue to work, and the `timestamp`
type is transparently aliased to `datetime`.
|
| |
|
| |
|
|
|
|
|
|
| |
This is an illustration of https://github.com/rails/rails/pull/13435#issuecomment-33789752
Removing the limit from the PG and SQLite adapter solves the issue.
MySQL is still affected by the issue.
|
|
|
|
|
|
|
|
| |
Follow-Up to https://github.com/rails/rails/pull/14348
Ensure that SQLCounter.clear_log is called after each test.
This is a step to prevent side effects when running tests. This will allow us to run them in random order.
|
|
|
|
|
|
| |
Previously when reverting a migration which added a named index it
would instead drop a corresponding index with matching columns but
without a name.
|
|
|
|
| |
Closes #13623.
|
|
|
|
|
|
|
|
|
| |
- Earlier, change_table was creating database-agnostic object.
- After this change, it will create correct object based on current
database adapter.
- This will ensure that create_table and change_table will get same objects.
- This makes update_table_definition method public and nodoc.
- Fixes #13577 and #13503
|
|
|
|
|
|
| |
renamed to `Minitest`
Ref: https://github.com/seattlerb/minitest/blob/master/History.txt
|
| |
|
|
|
|
|
|
|
| |
We can conditional define the tests depending on the adapter or
connection.
Lets keep the skip for fail tests that need to be fixed.
|
|
|
|
|
| |
If 'enable_extension' is used in a migration's 'change' method, use
'disable_extension' on down migration (and vice-versa).
|
| |
|
|
|
|
| |
see discussion here #11274
|
|
|
|
|
|
| |
When then PostgreSQL visitor was [added](https://github.com/rails/rails/commit/6b7fdf3bf3675a14eae74acc5241089308153a34)
`add_column` was no longer receiving the column options directly. This
caused the options to be lost along the way.
|
|
|
|
|
|
| |
because this was deprecated.
Some testcases is failed, so I replaced nil to empty hash in add_reference.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #9483.
There are SQL Queries that can't run inside a transaction. Since
the Migrator used to wrap all Migrations inside a transaction there
was no way to run these queries within a migration.
This patch adds `self.disable_ddl_transaction!` to the migration to
turn transactions off when necessary.
|
|
|
|
| |
because of Oracle database index length spec.
|
| |
|
|
|
|
|
|
|
|
| |
I renamed the test to better communicate it's intention. Since it also tests:
- add_column
- remove_column
- change_column
There is no reason to call it rename_column_test.
|
| |
|
| |
|
|
|
|
| |
When a table or a column is renamed related indexes kept their name. This will lead to confusing names. This patch renames related indexes when a column or a table is renamed. Only indexes with names generated by rails will be renamed. Indexes with custom names will not be renamed.
|
|
|
|
|
|
|
|
|
|
|
| |
Some adapter (SQLite3) need to perform renaming operations to support
the rails DDL. These rename prefixes operate with prefixes. When an
index name already uses up the full space provieded by
`index_name_length` these internal operations will fail. This patch
introduces `allowed_index_name_length` which respects the amount of
characters used for internal operations. It will always be <=
`index_name_length` and every adapter can define how many characters
need to be reserved.
|
|
|
|
| |
Cleanup change_schema tests to remove extra sorts on columns.
|
| |
|
|
|
|
|
|
|
| |
database
Not only PostgreSQL, Oracle database adapter drops the multi-column index
if any of the indexed columns dropped by remove_column.
|
| |
|
|
|
|
|
| |
minitest/autorun load minitest/spec polluting the global namespace with
the DSL that we don't want on Rails
|
|
|
|
|
|
| |
There were a couple of tests, which had FIXME comments in palce of
assertions. I replaced these FIXME comments with actual assertions to
get more feedback from our test suite.
|
| |
|
|
|
|
| |
[#8267]
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
reversible.
[#8267]
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pending work on graceful app upgrades.
Revert "Merge pull request #8439 from joshsusser/fixes"
This reverts commit ce8ac39338f86388e70356b3a470b3ea443802ae, reversing
changes made to b0e7b6f67c984d4b1502e801781ed75fad681633.
Revert "Merge pull request #8431 from joshsusser/schemadump"
This reverts commit 036d3e1c2b65c4b8cbd23de2e20ad67b9b756182, reversing
changes made to 0c692f4d121792117b6a71e5ed590a31c3b9d12e.
Revert "Merge branch 'joshsusser-master' into merge"
This reverts commit 0c692f4d121792117b6a71e5ed590a31c3b9d12e, reversing
changes made to 2e299fca715b083a60222a85e48f9d3b8dd8ce93.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
activerecord/test/cases/schema_dumper_test.rb
|
| |
|
|
|
|
|
| |
migrated_at: timestamp when migration run
fingerprint: md5 hash of migration source
name: filename without version or extension
|
| |
|