Backfill pattern analysis flag on existing banners
Set pattern_analysis_requested_at on all existing banners so the worker runs once per banner on release and merges any existing prefix groups. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -30,20 +30,20 @@ import (
|
|||||||
|
|
||||||
type (
|
type (
|
||||||
CookieBanner struct {
|
CookieBanner struct {
|
||||||
ID gid.GID `db:"id"`
|
ID gid.GID `db:"id"`
|
||||||
OrganizationID gid.GID `db:"organization_id"`
|
OrganizationID gid.GID `db:"organization_id"`
|
||||||
Name string `db:"name"`
|
Name string `db:"name"`
|
||||||
Origin string `db:"origin"`
|
Origin string `db:"origin"`
|
||||||
State CookieBannerState `db:"state"`
|
State CookieBannerState `db:"state"`
|
||||||
PrivacyPolicyURL *string `db:"privacy_policy_url"`
|
PrivacyPolicyURL *string `db:"privacy_policy_url"`
|
||||||
CookiePolicyURL string `db:"cookie_policy_url"`
|
CookiePolicyURL string `db:"cookie_policy_url"`
|
||||||
ConsentExpiryDays int `db:"consent_expiry_days"`
|
ConsentExpiryDays int `db:"consent_expiry_days"`
|
||||||
ConsentMode CookieConsentMode `db:"consent_mode"`
|
ConsentMode CookieConsentMode `db:"consent_mode"`
|
||||||
ShowBranding bool `db:"show_branding"`
|
ShowBranding bool `db:"show_branding"`
|
||||||
DefaultLanguage string `db:"default_language"`
|
DefaultLanguage string `db:"default_language"`
|
||||||
PatternAnalysisRequestedAt *time.Time `db:"pattern_analysis_requested_at"`
|
PatternAnalysisRequestedAt *time.Time `db:"pattern_analysis_requested_at"`
|
||||||
CreatedAt time.Time `db:"created_at"`
|
CreatedAt time.Time `db:"created_at"`
|
||||||
UpdatedAt time.Time `db:"updated_at"`
|
UpdatedAt time.Time `db:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
CookieBannerPatternAnalysisTask struct {
|
CookieBannerPatternAnalysisTask struct {
|
||||||
|
|||||||
@@ -14,3 +14,5 @@
|
|||||||
|
|
||||||
ALTER TABLE cookie_banners
|
ALTER TABLE cookie_banners
|
||||||
ADD COLUMN pattern_analysis_requested_at TIMESTAMP WITH TIME ZONE;
|
ADD COLUMN pattern_analysis_requested_at TIMESTAMP WITH TIME ZONE;
|
||||||
|
|
||||||
|
UPDATE cookie_banners SET pattern_analysis_requested_at = NOW();
|
||||||
|
|||||||
Reference in New Issue
Block a user