Fixes #3191 - data privacy obsolete column name.

This commit is contained in:
Rolf Schmidt 2020-09-15 09:35:49 +02:00 committed by Thorsten Eckel
parent 5dde117a14
commit b310ee519d
3 changed files with 10 additions and 3 deletions

View file

@ -1,5 +1,5 @@
class App.DataPrivacyTask extends App.Model
@configure 'DataPrivacyTask', 'name', 'state', 'deletable_id', 'deletable_type', 'preferences'
@configure 'DataPrivacyTask', 'state', 'deletable_id', 'deletable_type', 'preferences'
@extend Spine.Model.Ajax
@url: @apiPath + '/data_privacy_tasks'
@configure_attributes = [

View file

@ -742,7 +742,6 @@ class CreateBase < ActiveRecord::Migration[4.2]
add_index :smime_certificates, [:subject]
create_table :data_privacy_tasks do |t|
t.column :name, :string, limit: 150, null: true
t.column :state, :string, limit: 150, default: 'in process', null: true
t.references :deletable, polymorphic: true
t.string :preferences, limit: 8000, null: true
@ -750,7 +749,6 @@ class CreateBase < ActiveRecord::Migration[4.2]
t.column :created_by_id, :integer, null: false
t.timestamps limit: 3, null: false
end
add_index :data_privacy_tasks, [:name]
add_index :data_privacy_tasks, [:state]
end
end

View file

@ -0,0 +1,9 @@
class DataPrivacyDeleteName < ActiveRecord::Migration[5.2]
def change
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
remove_column :data_privacy_tasks, :name, :string, limit: 150
end
end