| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This allows to create and remove foreign keys without specifying a column.
|
| |
|
| |
|
|
|
|
| |
respect `table_name_prefix` and `table_name_suffix`.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Don't type cast the default on the column
|
| |
| |
| |
| |
| |
| |
| | |
If we want to have type decorators mess with the attribute, but not the
column, we need to stop type casting on the column. Where possible, we
changed the tests to test the value of `column_defaults`, which is
public API. `Column#default` is not.
|
|\ \
| |/
|/| |
Add test cases for Migration#inverse_of
|
| | |
|
|\ \
| | |
| | | |
Skip migration check if adapter doesn't support it
|
| | | |
|
| |/
|/| |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
|