| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`1_valid_people_have_last_names.rb` and
`20150823202140_create_users.rb` are valid migration file name.
But `1_valid_people_have_last_names.rb` is rendered as
`********** NO FILE **********` when `rake db:migrate:status`.
Fix to this bug, this commit includes
* define some API private methdos and a Constant
`match_to_migration_filename?`, `parse_migration_filename`, and
`MigrationFilenameRegexp`
* use these methods in `db:migrate:status` task
Example:
These files are in `db/migrate`
* 1_valid_people_have_last_names.rb
* 20150819202140_irreversible_migration.rb
* 20150823202140_add_admin_flag_to_users.rb
* 20150823202141_migration_tests.rb
* 2_we_need_reminders.rb
* 3_innocent_jointable.rb
we can migrate all of them.
Before
```shell
$ bundle exec rake db:migrate:status
...
Status Migration ID Migration Name
--------------------------------------------------
up 001 ********** NO FILE **********
up 002 ********** NO FILE **********
up 003 ********** NO FILE **********
up 20150819202140 Irreversible migration
up 20150823202140 Add admin flag to users
up 20150823202141 Migration tests
```
After
```shell
$ bundle exec rake db:migrate:status
...
Status Migration ID Migration Name
--------------------------------------------------
up 001 Valid people have last names
up 002 We need reminders
up 003 Innocent jointable
up 20150819202140 Irreversible migration
up 20150823202140 Add admin flag to users
up 20150823202141 Migration tests
```
|
|\ \ \ \
| | | | |
| | | | | |
Fix test_database_created_by_root of mysql
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
`DEFAULT_CHARSET` and `DEFAULT_COLLATION` in `MySQLDatabaseTasks`
was changed by 322068fe85278ea26e26da6dfd7c5612dab15a72.
This test case also should be changed.
|
|\ \ \ \
| |/ / /
|/| | | |
[ci skip] querying guide methods first and last: mentioning the influence of the default scope
|
| | | |
| | | |
| | | |
| | | | |
the default scope
|
|\ \ \ \
| | | | |
| | | | | |
remove unnecessary `.sass-cache` from plugin's gitignore template
|
| |/ / /
| | | |
| | | |
| | | | |
Since the sass cache is output to the `tmp/cache/sass`.
|
|\ \ \ \
| | | | |
| | | | | |
Define `sanitize_sql_for_order` for AR and use it inside `preprocess_…
|
|/ / / /
| | | |
| | | |
| | | | |
This commit follows up of 6a6dbb4c51fb0c58ba1a810eaa552774167b758a.
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Allow bigint with default nil for avoiding auto increment primary key
|
|/ / / /
| | | |
| | | |
| | | | |
Such as #10404, #18206.
|
|\ \ \ \
| | | | |
| | | | | |
Remove `DEFAULT_CHARSET` and `DEFAULT_COLLATION`
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit f6ca7e4e75408bc42f515fc7206d6c6ff0dce7c6.
The default collation of utf8 in MySQL is the `utf8_general_ci`, and
this should not be changed. This is because, the better collation in the
all locales is not exists, optimal collation in own application is not
known other than themselves.
The `utf8_unicode_ci` is known as Japanese killer in Japan, there are
serious impacts in search of Japanese.
MySQL implements the `utf8_unicode_ci` according to the Unicode
Collation Algorithm (UCA) described at http://www.unicode.org/reports/tr10/,
but the `utf8_unicode_ci` have only partial support for the UCA, only
primary level key comparison implemented (also known as L1 (Base
characters) comparison).
Because L1 (Base characters) comparison does not distinguish between the
presence or absence of the accent, if distinction of the accent is
important there is a serious impact (e.g. Japanese).
Example:
```
> SHOW CREATE TABLE `dicts`\G
*************************** 1. row ***************************
Table: dicts
Create Table: CREATE TABLE `dicts` (
`word` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`meaning` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
1 row in set (0.00 sec)
> INSERT INTO `dicts` VALUES ('ハハ', 'mother'), ('パパ', 'father');
Query OK, 2 rows affected (0.00 sec)
> SELECT * FROM `dicts` WHERE `word` = 'ハハ';
+--------+---------+
| word | meaning |
+--------+---------+
| ハハ | mother |
| パパ | father |
+--------+---------+
2 rows in set (0.00 sec)
> CREATE UNIQUE INDEX `unique_index_word` ON `dicts`(`word`);
ERROR 1062 (23000): Duplicate entry 'ハハ' for key 'unique_index_word'
```
We should omit the collation entirely rather than providing a default.
Then the choice is the responsibility of the server and MySQL distribution.
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Add CHANGELOG entry for #22125 [ci skip]
|
|/ / / / |
|
|\ \ \ \
| |_|/ /
|/| | | |
Move some AR test cases to inheritance_test.rb
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
These methods are defined in inheritance.rb
* `abstract_class?`
* `descends_from_active_record?`
* `compute_type`
|
|\ \ \ \
| | | | |
| | | | | |
Update changelog for #22122
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Fix double word 'string' [ci skip]
|
|/ / / / |
|
|\ \ \ \
| |_|/ /
|/| | | |
Route generator should be idempotent
|
| | | | |
|
|\ \ \ \ |
|
| | | | | |
|
| | | | |
| | | | |
| | | | | |
It improves readability of docs
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
https://github.com/rails/rails/commit/e768c519fb6015e00961702a5165c6dab548a954 bang version produces `KeyError` [ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This reverts commit efbd62f0c5c927a08e860b318b7bb561b2602a98.
Right now Eastern Time zone is on daylight saving, so the output in the
documentation is different but this doesn't mean that it is wrong.
Daylight savings only happen in 3 months in a year so it is better to
use the normal time zone in the documentation.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
‘Asserts’ at all places [ci skip]
Following commit https://github.com/rails/docrails/commit/495722a95687e25114ae75608dd3107ac5d6611b
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
skip]
`A UNIQUE` we pronounce URL as 'yu-ni-k’. We use this everywhere. So, be consistent with it.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix double word 'be' [ci skip]
|
|/ / / / / |
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
minor formatting changes [ci skip]
|
|/ / / /
| | | |
| | | |
| | | |
| | | | |
* add newline for display the fenced code block
* add "#" in the comments section
|
| | | |
| | | |
| | | |
| | | |
| | | | |
this allows us to construct mailer objects without possibly disastrous
side-effects.
|
|\ \ \ \
| | | | |
| | | | | |
Alias left_joins to left_outer_joins
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add test for parsing application/vnd.api+json
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
rails/application: allow passing an env to config_for
|
|/ / / / / / |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
we should be using a countdown latch instead of rolling our own
busy-loop.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
samphilipd/sam/manual_locking_on_schema_migrations
Make migrations concurrent safe (using advisory locks)
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
- Addresses issue #22092
- Works on Postgres and MySQL
- Uses advisory locks because of two important properties:
1. The can be obtained outside of the context of a transaction
2. They are automatically released when the session ends, so if a
migration process crashed for whatever reason the lock is not left
open perpetually
- Adds get_advisory_lock and release_advisory_lock methods to database
adapters
- Attempting to run a migration while another one is in process will
raise a ConcurrentMigrationError instead of attempting to run in
parallel with undefined behavior. This could be rescued and
the migration could exit cleanly instead. Perhaps as a configuration
option?
Technical Notes
==============
The Migrator uses generate_migrator_advisory_lock_key to build the key
for the lock. In order to be compatible across multiple adapters there
are some constraints on this key.
- Postgres limits us to 64 bit signed integers
- MySQL advisory locks are server-wide so we have to scope to the
database
- To fulfil these requirements we use a Migrator salt (a randomly
chosen signed integer with max length of 31 bits) that identifies
the Rails migration process as the owner of the lock. We multiply
this salt with a CRC32 unsigned integer hash of the database name to
get a signed 64 bit integer that can also be converted to a string
to act as a lock key in MySQL databases.
- It is important for subsequent versions of the Migrator to use the
same salt, otherwise different versions of the Migrator will not see
each other's locks.
|
| |_|/ / / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This assumes only one query was ever executed, but it appears to
sometimes be loading schema information. We can just look at the array
of queries, rather than the "first" one that was run
|