diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-11-02 13:26:03 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-11-02 13:26:03 +0000 |
commit | 74b5dce44aa902364d7ff3a3d8f6a1fcd857993d (patch) | |
tree | f7dccada69e33167d85a39cd173ab03c845d9436 | |
parent | a96aeddfa942501533089e22fb25f72ea5e77790 (diff) | |
parent | d32a571acbebd8655991f09e63302e59ca646f68 (diff) | |
download | gitlab-ce-74b5dce44aa902364d7ff3a3d8f6a1fcd857993d.tar.gz |
Merge branch 'rd-set-missing-fields-on-migration' into 'master'
Fixes a migration that causes error on some legacy DBs
Closes #46862
See merge request gitlab-org/gitlab-ce!22761
-rw-r--r-- | db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb b/db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb index 8fc558be733..b7b346cb10e 100644 --- a/db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb +++ b/db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb @@ -45,7 +45,7 @@ class CreateMissingNamespaceForInternalUsers < ActiveRecord::Migration connection.exec_query(query).present? end - insert_query = "INSERT INTO namespaces(owner_id, path, name) VALUES(#{user_id}, '#{path}', '#{path}')" + insert_query = "INSERT INTO namespaces(owner_id, path, name, created_at, updated_at) VALUES(#{user_id}, '#{path}', '#{path}', NOW(), NOW())" namespace_id = connection.insert_sql(insert_query) create_route(namespace_id) @@ -57,7 +57,7 @@ class CreateMissingNamespaceForInternalUsers < ActiveRecord::Migration row = connection.exec_query("SELECT id, path FROM namespaces WHERE id=#{namespace_id}").first id, path = row.values_at('id', 'path') - execute("INSERT INTO routes(source_id, source_type, path, name) VALUES(#{id}, 'Namespace', '#{path}', '#{path}')") + execute("INSERT INTO routes(source_id, source_type, path, name, created_at, updated_at) VALUES(#{id}, 'Namespace', '#{path}', '#{path}', NOW(), NOW())") end def set_notification_email(user_id) |