Wir haben dem Ticket ein Objekt (Text eingeben) hinzugefügt. Standardwert eingestellt.
Wir fügen ein neues Ticket hinzu. Es gibt zwei verschiedene Möglichkeiten, mit diesem neuen Feld umzugehen.
Ergänzung: Dies betrifft nicht nur Web- und Kommunikationskanäle, sondern auch API-Aufrufe.
Ja, ich bin sicher, dass dies ein Fehler ist und keine Funktionsanforderung oder eine allgemeine Frage.
Beim Testen der Entwicklung auf meiner Testinstanz ist ein Fehler im Zusammenhang mit diesem Fix für diesen Fehler aufgetreten:
Ich bin mir nicht sicher, ob dies ein Fehler oder nur ein Artefakt beim Ausführen eines WIP ist, das gerade entwickelt wird, aber ich teile es hier nur für den Fall.
# bundle exec rails db:migrate
I, [2019-09-04T16:34:00.264931 #22-47398444451260] INFO -- : Setting.set('models_searchable', ["Chat::Session", "User", "KnowledgeBase::Answer::Translation", "Organization", "Ticket"])
I, [2019-09-04T16:34:00.942238 #22-47398444451260] INFO -- : Migrating to Issue1653DefaultValueNotSetForSelectInputEtc (20190816091726)
== 20190816091726 Issue1653DefaultValueNotSetForSelectInputEtc: migrating =====
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Attribute not editable!
/opt/zammad/app/models/object_manager/attribute.rb:933:in `check_editable'
/opt/zammad/app/models/object_manager/attribute.rb:353:in `add'
/opt/zammad/db/migrate/20190816091726_issue_1653_default_value_not_set_for_select_input_etc.rb:10:in `block in change'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in `each'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in `each'
/opt/zammad/db/migrate/20190816091726_issue_1653_default_value_not_set_for_select_input_etc.rb:6:in `change'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:814:in `exec_migration'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:797:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:796:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212:in `transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `each'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1036:in `up'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <main>'
/usr/local/bundle/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/usr/local/bundle/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/usr/local/bundle/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/usr/local/bundle/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<main>'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
bin/rails:9:in `<main>'
Caused by:
Attribute not editable!
/opt/zammad/app/models/object_manager/attribute.rb:933:in `check_editable'
/opt/zammad/app/models/object_manager/attribute.rb:353:in `add'
/opt/zammad/db/migrate/20190816091726_issue_1653_default_value_not_set_for_select_input_etc.rb:10:in `block in change'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in `each'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in `each'
/opt/zammad/db/migrate/20190816091726_issue_1653_default_value_not_set_for_select_input_etc.rb:6:in `change'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:814:in `exec_migration'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:797:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:796:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212:in `transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `each'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1036:in `up'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <main>'
/usr/local/bundle/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/usr/local/bundle/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/usr/local/bundle/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/usr/local/bundle/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<main>'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/usr/local/bundle/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/usr/local/bundle/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
bin/rails:9:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Hallo @abeluck -
Hey @abeluck - nach einer längeren Diskussion mussten wir die Änderungen aufgrund der damit verbundenen Nebenwirkungen (insbesondere bei größeren Systemen)
Das Problem ist, dass eine Änderung oder Einführung eines Standardwerts eines Attributs zu einer Änderungstabelle führt, die auf größeren Systemen viel Zeit in Anspruch nimmt. Daher wird ein anwendungsbasierter Standardwert (über einen ActiveRecord-Rückruf) einem datenbankbasierten vorgezogen.
Auf jeden Fall sollten Sie in etwa 30 Minuten in der Lage sein, Ihr Testsystem auf develop
zu aktualisieren.
Hilfreichster Kommentar
Hey @abeluck - nach einer längeren Diskussion mussten wir die Änderungen aufgrund der damit verbundenen Nebenwirkungen (insbesondere bei größeren Systemen)
Das Problem ist, dass eine Änderung oder Einführung eines Standardwerts eines Attributs zu einer Änderungstabelle führt, die auf größeren Systemen viel Zeit in Anspruch nimmt. Daher wird ein anwendungsbasierter Standardwert (über einen ActiveRecord-Rückruf) einem datenbankbasierten vorgezogen.
Auf jeden Fall sollten Sie in etwa 30 Minuten in der Lage sein, Ihr Testsystem auf
develop
zu aktualisieren.