AeThex-OS/temp-connect-extract/AeThex-Connect-main/integration-package/migrations/001_domain_verifications.sql
MrPiglr b3c308b2c8 Add functional marketplace modules, bottom nav bar, root terminal, arcade games
- ModuleManager: Central tracking for installed marketplace modules
- DataAnalyzerWidget: Real-time CPU/RAM/Battery/Storage widget (unlocked by Data Analyzer module)
- BottomNavBar: Navigation bar for Projects/Chat/Marketplace/Settings
- RootShell: Real root command execution utility
- TerminalActivity: Full root shell with neofetch, sysinfo, real Linux commands
- Terminal Pro module: Adds aliases (ll, la, h), command history
- ArcadeActivity + SnakeGame: Pixel Arcade module unlocks retro games
- fade_in/fade_out animations for smooth transitions
2026-02-18 22:03:50 -07:00

36 lines
1.8 KiB
SQL

-- Database Schema for Domain Verification Feature
-- Run this migration to create the necessary tables
-- Verification Requests Table
CREATE TABLE IF NOT EXISTS domain_verifications (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL,
domain VARCHAR(255) NOT NULL,
verification_token VARCHAR(64) NOT NULL,
verification_type VARCHAR(20) CHECK (verification_type IN ('dns', 'blockchain')) DEFAULT 'dns',
verified BOOLEAN DEFAULT false,
created_at TIMESTAMP DEFAULT NOW(),
verified_at TIMESTAMP,
expires_at TIMESTAMP DEFAULT NOW() + INTERVAL '7 days',
CONSTRAINT unique_user_domain UNIQUE(user_id, domain)
);
-- Create index for faster lookups
CREATE INDEX IF NOT EXISTS idx_domain_verifications_user_id ON domain_verifications(user_id);
CREATE INDEX IF NOT EXISTS idx_domain_verifications_domain ON domain_verifications(domain);
CREATE INDEX IF NOT EXISTS idx_domain_verifications_verified ON domain_verifications(verified);
-- Users Table Extensions
-- Assumes users table already exists
ALTER TABLE users
ADD COLUMN IF NOT EXISTS verified_domain VARCHAR(255),
ADD COLUMN IF NOT EXISTS domain_verified_at TIMESTAMP;
-- Create index for verified domains
CREATE INDEX IF NOT EXISTS idx_users_verified_domain ON users(verified_domain) WHERE verified_domain IS NOT NULL;
-- Comments for documentation
COMMENT ON TABLE domain_verifications IS 'Stores domain verification requests and their status';
COMMENT ON COLUMN domain_verifications.verification_token IS 'Unique token to be added to DNS TXT record or wallet address for blockchain verification';
COMMENT ON COLUMN domain_verifications.verification_type IS 'Type of verification: dns for traditional domains, blockchain for .aethex domains';
COMMENT ON COLUMN domain_verifications.expires_at IS 'Verification request expires after 7 days';