Merge branch '8784-dir-listings'
[arvados.git] / services / api / db / migrate / 20140918141529_change_user_owner_uuid_not_null.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 class ChangeUserOwnerUuidNotNull < ActiveRecord::Migration
6   include CurrentApiClient
7
8   def up
9     User.update_all({owner_uuid: system_user_uuid}, 'owner_uuid is null')
10     change_column :users, :owner_uuid, :string, :null => false
11   end
12
13   def down
14     change_column :users, :owner_uuid, :string, :null => true
15   end
16 end