File size: 511 Bytes
62e1b50 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | CREATE TABLE writing_sessions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL,
project_id UUID,
chapter_id UUID,
session_start TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc',
now()),
session_end TIMESTAMP WITH TIME ZONE,
words_written INTEGER DEFAULT 0,
session_type TEXT DEFAULT 'writing' CHECK (session_type IN ('writing',
'editing',
'planning',
'research')),
created_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc',
now())
); |