From e02b42303bd0233a75a452344021088e4f3eb75d Mon Sep 17 00:00:00 2001 From: yingshinlee <8070998+yingshinlee@users.noreply.github.com> Date: Wed, 17 Jun 2026 20:05:23 +0800 Subject: [PATCH] feat(campaign): default the quote wall on for every campaign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Interim: drop the 七日書-only restriction and open the quote wall for all campaigns. Flip enable_quote_wall default to true and enable it on all existing campaigns. The per-campaign flag is kept as a future hook (OSS toggle / 七日書-only restriction can be wired to it later without a schema change). Co-Authored-By: Claude Opus 4.8 --- ...r_campaign_enable_quote_wall_default_on.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 db/migrations/20260617000200_alter_campaign_enable_quote_wall_default_on.js diff --git a/db/migrations/20260617000200_alter_campaign_enable_quote_wall_default_on.js b/db/migrations/20260617000200_alter_campaign_enable_quote_wall_default_on.js new file mode 100644 index 000000000..9e492c61e --- /dev/null +++ b/db/migrations/20260617000200_alter_campaign_enable_quote_wall_default_on.js @@ -0,0 +1,20 @@ +const table = 'campaign' + +// Interim decision: open the quote wall for every campaign by default, instead +// of the original 七日書-only opt-in. The per-campaign `enable_quote_wall` flag +// is kept (as a future hook for the OSS toggle / 七日書-only restriction); we +// only flip its default to true and enable it on all existing campaigns. +export const up = async (knex) => { + await knex.schema.alterTable(table, (t) => { + t.boolean('enable_quote_wall').notNullable().defaultTo(true).alter() + }) + await knex(table).update({ enable_quote_wall: true }) +} + +export const down = async (knex) => { + // revert the default; existing per-campaign values are left as-is (the prior + // mixed state cannot be reconstructed) + await knex.schema.alterTable(table, (t) => { + t.boolean('enable_quote_wall').notNullable().defaultTo(false).alter() + }) +}