Commit Graph

5 Commits

Author SHA1 Message Date
Jan Provaznik 0fc9f9d3e7 Add version 4.2 to all existing migrations
DB schema generated by a migration may look different in
rails 4 and 5 (because rails 5 may use different default values).
For this reason it's important to explicitly set for which rails
version a migration was written for.

See https://stackoverflow.com/questions/35929869/activerecordmigration-deprecation-warning-asks-for-rails-version-but-im-no/35930912#35930912
2018-11-22 13:18:28 +01:00
Stan Hu e97671b812 Simplify implementation and allow for batch updates in MySQL 2017-12-27 07:11:54 -08:00
Stan Hu dfdf22c7d8 Fix PostgreSQL implementation of migration 2017-12-27 04:12:18 -08:00
Stan Hu 5cacdc4ec1 Fix migration for removing orphaned issues.moved_to_id values in MySQL
According to https://dev.mysql.com/doc/refman/5.7/en/update.html,
"You cannot update a table and select from the same table in a subquery."
Attempting to do so results in the error:

```
Mysql2::Error: Table 'issues' is specified twice, both as a target for 'UPDATE' and as a separate source for data
```

Instead, we can use a LEFT JOIN on the same table to make MySQL do the right
thing.

Closes #41498
2017-12-26 22:29:15 -08:00
Yorick Peterse d825c9cb5d
Clean up schema of the "issues" table
This adds various foreign key constraints, indexes, missing NOT NULL
constraints, and changes some column types from timestamp to
timestamptz.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/31811
2017-11-09 18:00:30 +01:00