Files
discourse/db/migrate/20250311073009_enable_welcome_banner_new_sites.rb
Martin Brennan 64f1b97e0c FEATURE: Add welcome banner to core (#31516)
This is a stripped-back version of the Search Banner
component https://meta.discourse.org/t/search-banner/122939,
which will be renamed to Advanced Search Banner,
see https://github.com/discourse/discourse-search-banner/pull/84.

This welcome banner interacts with the header search.
When `search_experience` is set to `search_field`, we only
show the header search after the welcome banner scrolls
out of view, and vice-versa.

Only new sites will get this feature turned on by default,
existing sites have a migration to disable it.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
2025-03-17 12:18:08 +10:00

16 lines
420 B
Ruby

# frozen_string_literal: true
#
class EnableWelcomeBannerNewSites < ActiveRecord::Migration[7.2]
def up
execute <<~SQL if Migration::Helpers.existing_site?
INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
VALUES('enable_welcome_banner', 5, 'f', NOW(), NOW())
ON CONFLICT (name) DO NOTHING
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end