Commit Graph

10 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
Lin Jen-Shin b95da565cd Enable rubocop for db/**/* and ee/db/**/* 2018-07-25 17:47:12 +08:00
Yorick Peterse c6744b4949
Fixed locking syntax for PostgreSQL 2016-06-14 12:19:38 +02:00
Yorick Peterse d032c6b0ff
Move LOCK TABLES to a separate execute
MySQL apparently doesn't support executing multiple queries in the same
`execute` call so we have to use a separate one for the "LOCK TABLES"
statement.
2016-06-14 12:19:38 +02:00
Z.J. van de Weg fc5b3a8fa5
Fix MySQL migration, obtain lock the right way
As suggested by @yorrickpeterse in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4581#note_12373882
the locking of the MySQL database wasn't correct.
2016-06-14 12:19:38 +02:00
Z.J. van de Weg f8290c2862
Fix timing issues on convertion migration award emoji
This commit does two things:
1. It adds logic which prevents timing issues when running the
migration. During the migration, notes can be created which _should_
be award emoji and thus migrated. To prevent these timing issues, a
lock is obtained on the table (MySQL) or on Transaction level (PG).
2. There was no down migration before as you'd probably lose some data.
Data effected is all awards on notes. These could be migrated back, as
the noteable type would just be Note, though this would litter the DB
with data which should not be there. This down migration does not yet
delete the table.
2016-06-14 12:19:38 +02:00
Sean McGivern 98bb435f42 Enable RuboCop for migrations
Migrations shouldn't fail RuboCop checks - especially lint checks, such
as the nested method check. To avoid changing code in existing
migrations, add the magic comment to the top of each of them to skip
that file.
2016-06-09 16:05:25 +01:00
Z.J. van de Weg 91a7b9333b Incorportate feedback 2016-06-01 12:10:08 +02:00
Zeger-Jan van de Weg 4558b5b9fe Incorporate feedback 2016-05-11 22:43:58 +02:00
Zeger-Jan van de Weg 3bdc57f0a7 Create table for award emoji 2016-05-06 10:47:11 +02:00