22 lines
625 B
SQL
22 lines
625 B
SQL
-- Add Other catch-all to AriyaWay marketplace categories
|
|
ALTER TABLE categories ADD COLUMN IF NOT EXISTS tags TEXT[] NOT NULL DEFAULT '{}';
|
|
|
|
INSERT INTO categories (parent_id, name, name_fa, slug, sort_order, tags, is_active)
|
|
VALUES (
|
|
NULL,
|
|
'Other',
|
|
'سایر',
|
|
'other',
|
|
99,
|
|
ARRAY['other', 'misc', 'miscellaneous', 'uncategorized', 'general', 'سایر', 'متفرقه', 'عمومی']::text[],
|
|
TRUE
|
|
)
|
|
ON CONFLICT (slug) DO UPDATE SET
|
|
parent_id = NULL,
|
|
name = EXCLUDED.name,
|
|
name_fa = EXCLUDED.name_fa,
|
|
sort_order = EXCLUDED.sort_order,
|
|
tags = EXCLUDED.tags,
|
|
is_active = TRUE,
|
|
updated_at = NOW();
|