-- Migration script for tenant_paramesh schema
-- Run this in your database
SET search_path TO "tenant_paramesh";
-- Create skills table
CREATE TABLE IF NOT EXISTS skills (
    id SERIAL PRIMARY KEY,
    skill_identifier_code VARCHAR(50) UNIQUE NOT NULL,
    skill_designation VARCHAR(255) NOT NULL,
    skill_domain_category VARCHAR(50) NOT NULL DEFAULT 'technical',
    mandatory_certification_type VARCHAR(20),
    is_active BOOLEAN DEFAULT true,
    is_mandatory BOOLEAN DEFAULT false,
    sort_order INTEGER DEFAULT 0,
    status INTEGER DEFAULT 0,
    metadata JSONB,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Create index for faster lookups
CREATE INDEX idx_skills_domain_category ON skills(skill_domain_category);
CREATE INDEX idx_skills_is_active ON skills(is_active);
CREATE INDEX idx_skills_code ON skills(skill_identifier_code);