Skip to content

Commit 830e705

Browse files
committed
Ensure that all privacy columns default to private
1 parent aa1d944 commit 830e705

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# Ensure that all privacy columns are defaulted to private, as "unlisted" has been removed
4+
class EnsureAllPrivacyColumnsDefaultToPrivate < ActiveRecord::Migration[7.1]
5+
def up
6+
load ::BetterTogether::Engine.root.join('lib', 'tasks', 'data_migration.rake').to_s
7+
8+
begin
9+
Rake::Task['better_together:migrate_data:set_privacy_default_to_private'].invoke
10+
rescue RuntimeError
11+
Rake::Task['app:better_together:migrate_data:set_privacy_default_to_private'].invoke
12+
end
13+
end
14+
15+
def down; end
16+
end

spec/dummy/db/schema.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.1].define(version: 2025_06_04_195946) do
13+
ActiveRecord::Schema[7.1].define(version: 2025_06_05_204408) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "pgcrypto"
1616
enable_extension "plpgsql"
@@ -68,7 +68,7 @@
6868
t.string "state_province_name"
6969
t.string "postal_code"
7070
t.string "country_name"
71-
t.string "privacy", limit: 50, default: "unlisted", null: false
71+
t.string "privacy", limit: 50, default: "private", null: false
7272
t.uuid "contact_detail_id"
7373
t.boolean "primary_flag", default: false, null: false
7474
t.index ["contact_detail_id", "primary_flag"], name: "index_bt_addresses_on_contact_detail_id_and_primary", unique: true, where: "(primary_flag IS TRUE)"
@@ -189,7 +189,7 @@
189189
t.string "identifier", limit: 100, null: false
190190
t.boolean "host", default: false, null: false
191191
t.boolean "protected", default: false, null: false
192-
t.string "privacy", limit: 50, default: "public", null: false
192+
t.string "privacy", limit: 50, default: "private", null: false
193193
t.string "slug"
194194
t.uuid "creator_id"
195195
t.string "type", default: "BetterTogether::Community", null: false
@@ -227,7 +227,7 @@
227227
t.jsonb "media_settings", default: {}, null: false
228228
t.jsonb "content_data", default: {}
229229
t.uuid "creator_id"
230-
t.string "privacy", limit: 50, default: "unlisted", null: false
230+
t.string "privacy", limit: 50, default: "private", null: false
231231
t.boolean "visible", default: true, null: false
232232
t.jsonb "content_area_settings", default: {}, null: false
233233
t.index ["creator_id"], name: "by_better_together_content_blocks_creator"
@@ -282,7 +282,7 @@
282282
t.datetime "updated_at", null: false
283283
t.string "email", null: false
284284
t.string "label", null: false
285-
t.string "privacy", limit: 50, default: "unlisted", null: false
285+
t.string "privacy", limit: 50, default: "private", null: false
286286
t.uuid "contact_detail_id", null: false
287287
t.boolean "primary_flag", default: false, null: false
288288
t.index ["contact_detail_id", "primary_flag"], name: "index_bt_email_addresses_on_contact_detail_id_and_primary", unique: true, where: "(primary_flag IS TRUE)"
@@ -765,7 +765,7 @@
765765
t.text "meta_description"
766766
t.string "keywords"
767767
t.datetime "published_at"
768-
t.string "privacy", default: "public", null: false
768+
t.string "privacy", default: "private", null: false
769769
t.string "layout"
770770
t.string "template"
771771
t.uuid "sidebar_nav_id"
@@ -784,7 +784,7 @@
784784
t.string "slug"
785785
t.uuid "community_id", null: false
786786
t.jsonb "preferences", default: {}, null: false
787-
t.string "privacy", limit: 50, default: "unlisted", null: false
787+
t.string "privacy", limit: 50, default: "private", null: false
788788
t.index ["community_id"], name: "by_person_community"
789789
t.index ["identifier"], name: "index_better_together_people_on_identifier", unique: true
790790
t.index ["privacy"], name: "by_better_together_people_privacy"
@@ -823,7 +823,7 @@
823823
t.datetime "updated_at", null: false
824824
t.string "number", null: false
825825
t.string "label", null: false
826-
t.string "privacy", limit: 50, default: "unlisted", null: false
826+
t.string "privacy", limit: 50, default: "private", null: false
827827
t.uuid "contact_detail_id", null: false
828828
t.boolean "primary_flag", default: false, null: false
829829
t.index ["contact_detail_id", "primary_flag"], name: "index_bt_phone_numbers_on_contact_detail_id_and_primary", unique: true, where: "(primary_flag IS TRUE)"
@@ -889,7 +889,7 @@
889889
t.string "identifier", limit: 100, null: false
890890
t.boolean "host", default: false, null: false
891891
t.boolean "protected", default: false, null: false
892-
t.string "privacy", limit: 50, default: "public", null: false
892+
t.string "privacy", limit: 50, default: "private", null: false
893893
t.string "slug"
894894
t.uuid "community_id"
895895
t.string "url", null: false
@@ -968,7 +968,7 @@
968968
t.string "platform", null: false
969969
t.string "handle", null: false
970970
t.string "url"
971-
t.string "privacy", limit: 50, default: "public", null: false
971+
t.string "privacy", limit: 50, default: "private", null: false
972972
t.uuid "contact_detail_id", null: false
973973
t.index ["contact_detail_id", "platform"], name: "index_bt_sma_on_contact_detail_and_platform", unique: true
974974
t.index ["contact_detail_id"], name: "idx_on_contact_detail_id_6380b64b3b"
@@ -1021,7 +1021,7 @@
10211021
t.datetime "updated_at", null: false
10221022
t.string "url", null: false
10231023
t.string "label", null: false
1024-
t.string "privacy", limit: 50, default: "unlisted", null: false
1024+
t.string "privacy", limit: 50, default: "private", null: false
10251025
t.uuid "contact_detail_id", null: false
10261026
t.index ["contact_detail_id"], name: "index_better_together_website_links_on_contact_detail_id"
10271027
t.index ["privacy"], name: "by_better_together_website_links_privacy"

0 commit comments

Comments
 (0)