The domains table needs to be created in your Supabase database before you can manage domains.
Database Setup Required
The domains table doesn't exist in your Supabase database. Please run the SQL script below to set it up.
1. Go to your Supabase dashboard
2. Navigate to SQL Editor
3. Run the SQL script below
1. Configure your Supabase credentials
2. Run the setup script
npm run setup:domains-- Domains table for DNS management and validation
CREATE TABLE IF NOT EXISTS domains (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
user_id uuid REFERENCES auth.users(id) ON DELETE CASCADE,
domain text NOT NULL,
status text DEFAULT 'pending' CHECK (status IN ('pending', 'validating', 'active', 'failed', 'expired')),
-- DNS Configuration
verification_token text NOT NULL DEFAULT 'blo-' || substr(gen_random_uuid()::text, 1, 12),
required_a_record inet,
required_cname text,
hosting_provider text DEFAULT 'backlinkoo',
-- Validation tracking
dns_validated boolean DEFAULT false,
txt_record_validated boolean DEFAULT false,
a_record_validated boolean DEFAULT false,
cname_validated boolean DEFAULT false,
ssl_enabled boolean DEFAULT false,
-- Metadata
last_validation_attempt timestamptz,
validation_error text,
auto_retry_count integer DEFAULT 0,
max_retries integer DEFAULT 10,
-- Blog integration
blog_enabled boolean DEFAULT false,
blog_subdirectory text DEFAULT 'blog',
pages_published integer DEFAULT 0,
created_at timestamptz DEFAULT now(),
updated_at timestamptz DEFAULT now(),
UNIQUE(user_id, domain)
);
-- Enable RLS
ALTER TABLE domains ENABLE ROW LEVEL SECURITY;
-- RLS Policies
CREATE POLICY "Users can view own domains" ON domains
FOR SELECT USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own domains" ON domains
FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Users can update own domains" ON domains
FOR UPDATE USING (auth.uid() = user_id);
CREATE POLICY "Users can delete own domains" ON domains
FOR DELETE USING (auth.uid() = user_id);
-- Indexes for performance
CREATE INDEX IF NOT EXISTS idx_domains_user_id ON domains(user_id);
CREATE INDEX IF NOT EXISTS idx_domains_status ON domains(status);
CREATE INDEX IF NOT EXISTS idx_domains_domain ON domains(domain);
CREATE INDEX IF NOT EXISTS idx_domains_validation ON domains(dns_validated, status);What this script does:
domains table with all required columnsAfter running the SQL script:
Refresh this page to access the full domain management interface.