AI Resource Pro / website / scripts / add-missing-categories.sql
| 1 | -- Insert missing categories with appropriate icons |
| 2 | INSERT INTO categories (name, slug, icon, description) |
| 3 | VALUES |
| 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') |
| 10 | ON CONFLICT (name) DO NOTHING; |
| 11 | |
| 12 | -- Remove test tags from posts |
| 13 | UPDATE blog_posts |
| 14 | SET tags = array_remove(tags, 'tag1') |
| 15 | WHERE 'tag1' = ANY(tags); |
| 16 | |
| 17 | UPDATE blog_posts |
| 18 | SET tags = array_remove(tags, 'tag2') |
| 19 | WHERE 'tag2' = ANY(tags); |