Objective
Create a centralized brand asset library for managing logos, brand guidelines, and marketing materials. This ensures brand consistency across all channels and teams.
Step 1: Create Asset Categories Table
Define asset categories.
CREATE TABLE asset_categories (
id INTEGER PRIMARY KEY,
name VARCHAR(100) NOT NULL,
description TEXT,
parent_id INTEGER,
sort_order INTEGER DEFAULT 0,
is_active BOOLEAN DEFAULT TRUE,
FOREIGN KEY (parent_id) REFERENCES asset_categories(id)
);
Step 2: Create Brand Assets Table
Store brand assets.
CREATE TABLE brand_assets (
id INTEGER PRIMARY KEY,
category_id INTEGER NOT NULL,
name VARCHAR(255) NOT NULL,
description TEXT,
asset_type VARCHAR(50) NOT NULL,
file_image IMAGE(PNG),
file_pdf PDF,
format VARCHAR(20),
width INTEGER,
height INTEGER,
file_size BIGINT,
color_space VARCHAR(20),
usage_guidelines TEXT,
tags VARCHAR(500),
version VARCHAR(20) DEFAULT '1.0',
is_approved BOOLEAN DEFAULT TRUE,
is_public BOOLEAN DEFAULT FALSE,
download_count INTEGER DEFAULT 0,
created_by VARCHAR(100),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (category_id) REFERENCES asset_categories(id)
);
Step 3: Create Asset Usage Table
Track asset usage and downloads.
CREATE TABLE asset_usage (
id INTEGER PRIMARY KEY,
asset_id INTEGER NOT NULL,
used_by VARCHAR(100) NOT NULL,
usage_type VARCHAR(50),
project_name VARCHAR(255),
download_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (asset_id) REFERENCES brand_assets(id)
);
Step 4: Insert Asset Categories
Add category hierarchy.
INSERT INTO asset_categories (id, name, description, parent_id, sort_order) VALUES
(1, 'Logos', 'Official company logos', NULL, 1),
(2, 'Brand Guidelines', 'Brand identity guidelines', NULL, 2),
(3, 'Marketing Materials', 'Marketing and promotional assets', NULL, 3),
(4, 'Social Media', 'Social media assets', NULL, 4),
-- Logo subcategories
(5, 'Primary Logo', 'Main company logo variations', 1, 1),
(6, 'Secondary Logos', 'Alternative logo formats', 1, 2),
(7, 'Icon/Favicon', 'App icons and favicons', 1, 3),
-- Marketing subcategories
(8, 'Print Materials', 'Print-ready assets', 3, 1),
(9, 'Digital Banners', 'Web and email banners', 3, 2),
(10, 'Presentations', 'PowerPoint templates', 3, 3),
-- Social media subcategories
(11, 'Profile Images', 'Social profile pictures', 4, 1),
(12, 'Cover Images', 'Social cover photos', 4, 2),
(13, 'Post Templates', 'Social post templates', 4, 3);
Step 5: Insert Brand Assets
Add sample assets.
INSERT INTO brand_assets (id, category_id, name, description, asset_type, format, width, height, file_size, color_space, usage_guidelines, tags, version, is_public, created_by) VALUES
-- Primary logos
(1, 5, 'Primary Logo - Full Color', 'Main logo for light backgrounds', 'logo', 'PNG', 2000, 500, 125000, 'RGB', 'Use on white or light backgrounds only. Minimum size 100px wide.', 'logo,primary,color,main', '2.0', TRUE, 'brand_team'),
(2, 5, 'Primary Logo - White', 'White logo for dark backgrounds', 'logo', 'PNG', 2000, 500, 98000, 'RGB', 'Use on dark or colored backgrounds. Maintain contrast ratio.', 'logo,primary,white,dark', '2.0', TRUE, 'brand_team'),
(3, 5, 'Primary Logo - Black', 'Black logo for special applications', 'logo', 'PNG', 2000, 500, 95000, 'RGB', 'Use for grayscale or single-color printing.', 'logo,primary,black,mono', '2.0', TRUE, 'brand_team'),
-- Secondary logos
(4, 6, 'Horizontal Logo', 'Wide format logo variant', 'logo', 'PNG', 3000, 400, 145000, 'RGB', 'For horizontal spaces. Minimum width 200px.', 'logo,horizontal,wide', '1.5', TRUE, 'brand_team'),
(5, 6, 'Stacked Logo', 'Vertical stacked format', 'logo', 'PNG', 800, 1000, 112000, 'RGB', 'For vertical spaces and square areas.', 'logo,stacked,vertical', '1.5', TRUE, 'brand_team'),
-- Icons
(6, 7, 'App Icon', 'Mobile app icon', 'icon', 'PNG', 1024, 1024, 85000, 'RGB', 'For iOS and Android app stores.', 'icon,app,mobile', '3.0', TRUE, 'brand_team'),
(7, 7, 'Favicon', 'Website favicon', 'icon', 'PNG', 32, 32, 2500, 'RGB', 'For browser tabs and bookmarks.', 'favicon,browser,icon', '1.0', TRUE, 'brand_team'),
-- Digital banners
(8, 9, 'Email Header', 'Standard email header banner', 'banner', 'PNG', 600, 200, 75000, 'RGB', 'For email marketing campaigns.', 'email,header,banner', '1.2', FALSE, 'marketing'),
(9, 9, 'Web Banner - Leaderboard', 'Standard 728x90 banner', 'banner', 'PNG', 728, 90, 45000, 'RGB', 'Standard web advertising format.', 'web,banner,leaderboard', '1.0', FALSE, 'marketing'),
(10, 9, 'Web Banner - Skyscraper', 'Standard 160x600 banner', 'banner', 'PNG', 160, 600, 52000, 'RGB', 'Sidebar advertising format.', 'web,banner,skyscraper', '1.0', FALSE, 'marketing'),
-- Social media assets
(11, 11, 'LinkedIn Profile', 'LinkedIn company profile image', 'social', 'PNG', 300, 300, 35000, 'RGB', 'Square format for LinkedIn.', 'linkedin,profile,social', '1.0', FALSE, 'social_team'),
(12, 12, 'Twitter Cover', 'Twitter header image', 'social', 'PNG', 1500, 500, 125000, 'RGB', 'Twitter/X header dimensions.', 'twitter,cover,header', '1.0', FALSE, 'social_team');