File size: 638 Bytes
62e1b50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CREATE TABLE projects (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID NOT NULL,
    title TEXT NOT NULL,
    description TEXT,
    genre TEXT,
    tags TEXT[] DEFAULT '{}',
    status TEXT DEFAULT 'draft' CHECK (status IN ('draft',
    'in_progress',
    'completed',
    'published',
    'archived')),
    word_count INTEGER DEFAULT 0,
    target_word_count INTEGER,
    cover_image_url TEXT,
    language TEXT DEFAULT 'zh',
    is_public BOOLEAN DEFAULT false,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc',
    now()),
    updated_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc',
    now())
);