-- Migration: Add service_listings table
-- Run this against the fuelprices database to enable the service companies feature.
--
-- psql -h 192.168.1.204 -U <user> -d fuelprices -f migrate_service_listings.sql

CREATE TABLE IF NOT EXISTS service_listings (
    id SERIAL PRIMARY KEY,
    company_name VARCHAR(255) NOT NULL,
    is_active BOOLEAN DEFAULT true,
    twenty_four_hour BOOLEAN DEFAULT false,
    emergency_service BOOLEAN DEFAULT false,
    town VARCHAR(100),
    county_id INTEGER NOT NULL,
    phone VARCHAR(20),
    website VARCHAR(255),
    email VARCHAR(255),
    description TEXT,
    licensed_insured BOOLEAN DEFAULT false,
    service_area VARCHAR(255),
    years_experience INTEGER,
    user_id INTEGER NOT NULL,
    created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
    last_edited TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
);
