-- Initialize Dolibarr database for YDN integration
-- This script creates a separate database for Dolibarr

CREATE DATABASE dolibarr_db WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C';

-- Grant permissions
GRANT ALL PRIVILEGES ON DATABASE dolibarr_db TO ydn_user;

-- Create extension for UUID generation
\c dolibarr_db;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";