Sha256: eb79c67d0f90b855dc1ae6a43968ed8c672f2f238b9002220906adaf36895aae

Contents?: true

Size: 378 Bytes

Versions: 1

Compression:

Stored size: 378 Bytes

Contents

Sequel.migration do 
	change do 
		alter_table(:registry_settings) do
			add_column :from , String, :null => false, :default => 'USER'
		end
		settings = self[:registry_settings].select(:id,:version)
		admins = []
		settings.each do |set|
			admins <<  set[:id] if (set[:version] & 1) == 1
		end
		self[:registry_settings].where(:id => admins).update(:from => 'ADMIN')
 	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ocp_registry-0.0.5.pre lib/ocp_registry/db/004_add_from_field_for_settings.rb