Branchwell

AI Resource Pro / website / scripts / add-missing-categories.sql

1-- Insert missing categories with appropriate icons
2INSERT INTO categories (name, slug, icon, description)
3VALUES
4 ('AI Basics', 'ai-basics', 'Brain', 'Fundamental concepts and principles of artificial intelligence'),
5 ('AI Tools', 'ai-tools', 'Tool', 'Various tools and applications powered by artificial intelligence'),
6 ('Beginners', 'beginners', 'GraduationCap', 'Content tailored for those new to AI and machine learning'),
7 ('Business', 'business', 'Building2', 'AI applications and implications for business and enterprise'),
8 ('Machine Learning', 'machine-learning', 'Network', 'Topics related to machine learning algorithms and applications'),
9 ('Productivity', 'productivity', 'Rocket', 'Tools and techniques for enhancing productivity with AI')
10ON CONFLICT (name) DO NOTHING;
11
12-- Remove test tags from posts
13UPDATE blog_posts
14SET tags = array_remove(tags, 'tag1')
15WHERE 'tag1' = ANY(tags);
16
17UPDATE blog_posts
18SET tags = array_remove(tags, 'tag2')
19WHERE 'tag2' = ANY(tags);