21 lines
868 B
SQL
21 lines
868 B
SQL
-- Database Schema Update for Expert Profiles
|
|
|
|
-- Check if the table 'icon_experts' exists and add the new columns
|
|
-- 'hourlyRateOnsite' and 'hourlyRateRemote'.
|
|
-- Using numeric(10, 2) is suitable for currency values.
|
|
|
|
DO $$
|
|
BEGIN
|
|
-- Add hourlyRateOnsite column if it doesn't exist
|
|
IF NOT EXISTS (SELECT 1 FROM information_schema.columns
|
|
WHERE table_name = 'icon_experts' AND column_name = 'hourlyRateOnsite') THEN
|
|
ALTER TABLE icon_experts ADD COLUMN "hourlyRateOnsite" numeric(10, 2);
|
|
END IF;
|
|
|
|
-- Add hourlyRateRemote column if it doesn't exist
|
|
IF NOT EXISTS (SELECT 1 FROM information_schema.columns
|
|
WHERE table_name = 'icon_experts' AND column_name = 'hourlyRateRemote') THEN
|
|
ALTER TABLE icon_experts ADD COLUMN "hourlyRateRemote" numeric(10, 2);
|
|
END IF;
|
|
END $$;
|