kontenhumas-be/docs/migrations/002_add_client_tenant_field...

25 lines
1.1 KiB
SQL

-- Migration: Add tenant information fields to clients table
-- Date: 2025-01-27
-- Description: Add logo_url, address, phone_number, website fields to clients table
-- Add new columns to clients table
ALTER TABLE clients
ADD COLUMN logo_url VARCHAR(255),
ADD COLUMN logo_image_path VARCHAR(255),
ADD COLUMN address TEXT,
ADD COLUMN phone_number VARCHAR(50),
ADD COLUMN website VARCHAR(255);
-- Add comments for documentation
COMMENT ON COLUMN clients.logo_url IS 'URL of tenant logo';
COMMENT ON COLUMN clients.logo_image_path IS 'Path to logo image in MinIO storage';
COMMENT ON COLUMN clients.address IS 'Physical address of the tenant';
COMMENT ON COLUMN clients.phone_number IS 'Contact phone number of the tenant';
COMMENT ON COLUMN clients.website IS 'Official website URL of the tenant';
-- Optional: Create indexes for better query performance
CREATE INDEX IF NOT EXISTS idx_clients_logo_url ON clients(logo_url);
CREATE INDEX IF NOT EXISTS idx_clients_logo_image_path ON clients(logo_image_path);
CREATE INDEX IF NOT EXISTS idx_clients_phone_number ON clients(phone_number);
CREATE INDEX IF NOT EXISTS idx_clients_website ON clients(website);