feat(#2): Implement PostgreSQL 17 + pgvector database schema

Establishes multi-tenant database layer with vector similarity search for AI-powered memory features. Includes Docker infrastructure, Prisma ORM integration, NestJS services, and shared types across the monorepo.

Key changes:
- Docker: PostgreSQL 17 + pgvector v0.7.4, Valkey cache
- Schema: 8 models (User, Workspace, Task, Event, Project, ActivityLog, MemoryEmbedding) with RLS preparation
- NestJS: PrismaModule, DatabaseModule, EmbeddingsService
- Shared: Type-safe enums, constants, and database types

Fixes #2

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Jason Woltje
2026-01-28 16:06:34 -06:00
parent 355cf2124b
commit 99afde4f99
26 changed files with 1844 additions and 64 deletions

View File

@@ -0,0 +1,18 @@
-- Mosaic Stack Database Initialization Script
-- This script runs automatically when the PostgreSQL container is first created
-- Enable UUID extension for UUID generation
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- Enable pgvector extension for vector similarity search
CREATE EXTENSION IF NOT EXISTS "vector";
-- Set default timezone to UTC
SET timezone = 'UTC';
-- Log successful initialization
DO $$
BEGIN
RAISE NOTICE 'Mosaic Stack database initialized successfully';
RAISE NOTICE 'Extensions enabled: uuid-ossp, vector';
END $$;