[#45234] Remove default values from journal tables definition

https://community.openproject.org/work_packages/45234
pull/11801/head
Christophe Bliard 2 years ago
parent cf7bd75211
commit efac3f0a24
No known key found for this signature in database
GPG Key ID: 2BC07603210C3FA4
  1. 40
      db/migrate/20221213092910_remove_default_values_from_journal_tables_definition.rb

@ -0,0 +1,40 @@
class RemoveDefaultValuesFromJournalTablesDefinition < ActiveRecord::Migration[7.0]
# rubocop:disable Metrics/AbcSize
def change
change_table :attachable_journals, bulk: true do |t|
t.change_default :filename, from: '', to: nil
end
change_table :attachment_journals, bulk: true do |t|
t.change_default :filename, from: '', to: nil
t.change_default :disk_filename, from: '', to: nil
t.change_default :filesize, from: 0, to: nil
t.change_default :content_type, from: '', to: nil
t.change_default :digest, from: '', to: nil
t.change_default :downloads, from: 0, to: nil
end
change_table :document_journals, bulk: true do |t|
t.change_default :title, from: '', to: nil
end
change_table :message_journals, bulk: true do |t|
t.change_default :subject, from: '', to: nil
t.change_default :locked, from: false, to: nil
t.change_default :sticky, from: 0, to: nil
end
change_table :news_journals, bulk: true do |t|
t.change_default :title, from: '', to: nil
t.change_default :summary, from: '', to: nil
t.change_default :comments_count, from: 0, to: nil
end
change_table :work_package_journals, bulk: true do |t|
t.change_default :subject, from: '', to: nil
t.change_default :done_ratio, from: 0, to: nil
t.change_default :schedule_manually, from: false, to: nil
end
end
# rubocop:enable Metrics/AbcSize
end
Loading…
Cancel
Save