Skip to content

Commit

Permalink
Prefer adding new column to renaming
Browse files Browse the repository at this point in the history
- we can have a follow up ticket to drop the column if it is no longer
  used; however, we may add a new column that does not scope it to only
whats_app so that we can save the text to update signal/telegram about
text programamtically
  • Loading branch information
mattwr18 committed Nov 20, 2024
1 parent 0a1b378 commit 0a8f104
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
2 changes: 2 additions & 0 deletions app/dashboards/organization_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class OrganizationDashboard < Administrate::BaseDashboard
onboarding_additional_consent_text: Field::String,
channel_image: Field::ActiveStorage,
whats_app_more_info_message: Field::Text,
whats_app_profile_about: Field::Text,
signal_complete_onboarding_link: Field::Url,
whats_app_quick_reply_button_text: Field::JSONB
}.freeze
Expand Down Expand Up @@ -56,6 +57,7 @@ class OrganizationDashboard < Administrate::BaseDashboard
contact_person
business_plan
upgrade_discount
whats_app_profile_about
whats_app_more_info_message
onboarding_data_protection_link
onboarding_data_processing_consent_additional_info
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

class AddWhatsAppColumnsToOrganizations < ActiveRecord::Migration[6.1]
def change
change_table :organizations, bulk: true do |t|
t.jsonb :whats_app_quick_reply_button_text, default: { answer_request: 'Antworten', more_info: 'Mehr Infos' }
t.string :whats_app_more_info_message, default: ''
end
end
end
5 changes: 3 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_11_20_150844) do
ActiveRecord::Schema.define(version: 2024_11_20_182931) do

# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
Expand Down Expand Up @@ -230,11 +230,12 @@
t.string "three_sixty_dialog_client_id"
t.string "three_sixty_dialog_client_waba_account_id"
t.string "email_from_address"
t.string "whats_app_more_info_message", default: ""
t.string "whats_app_profile_about", default: ""
t.jsonb "onboarding_allowed", default: {"email"=>true, "signal"=>true, "threema"=>true, "telegram"=>true, "whats_app"=>true}
t.jsonb "twilio_content_sids", default: {"new_request_day1"=>"", "new_request_day2"=>"", "new_request_day3"=>"", "new_request_night1"=>"", "new_request_night2"=>"", "new_request_night3"=>"", "new_request_evening1"=>"", "new_request_evening2"=>"", "new_request_evening3"=>"", "new_request_morning1"=>"", "new_request_morning2"=>"", "new_request_morning3"=>""}
t.string "signal_complete_onboarding_link"
t.jsonb "whats_app_quick_reply_button_text", default: {"more_info"=>"Mehr Infos", "answer_request"=>"Antworten"}
t.string "whats_app_more_info_message", default: ""
t.index ["business_plan_id"], name: "index_organizations_on_business_plan_id"
t.index ["contact_person_id"], name: "index_organizations_on_contact_person_id"
t.index ["telegram_bot_username"], name: "index_organizations_on_telegram_bot_username", unique: true
Expand Down

0 comments on commit 0a8f104

Please sign in to comment.