Commit 615be5d887ca566c942aa003f9169009a82412ad

Authored by Gabriel Silva
1 parent 10aa67f6
Exists in fix_no_license

Adds a migration to fix softwares with no license

Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Signed-off-by: Omar Junior <omarroinuj@gmail.com>
src/noosfero-spb/software_communities/db/migrate/20160112191716_add_license_to_softwares_with_none.rb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +class AddLicenseToSoftwaresWithNone < ActiveRecord::Migration
  2 + def up
  3 + execute("UPDATE software_infos SET license_info_id=(SELECT id FROM license_infos WHERE version='Another') WHERE license_info_id IS NULL;")
  4 + end
  5 +
  6 + def down
  7 + say "This migration can't be reverted"
  8 + end
  9 +end
... ...