AI_Story
Tables (6)
Comments (comments)
- Comment ID (id) — BIGINT — Primary key — NOT NULL
- Posts ID (posts_id) — posts.id — Primary key — NOT NULL
- User ID (users.id) — users.id — Primary key — NOT NULL
- Content (content) — TEXT, not null
- Created At (created_at) — DATETIME
- Updated At (updated_at) — DATETIME
Posts (posts)
- Posts ID (id) — BIGINT — Primary key — NOT NULL
- User ID (user_id) — users.id — Primary key — NOT NULL
- Story ID (story_id) — VARCHAR(255), not null — Primary key — NOT NULL
- User ID (id2) — BIGINT, auto_increment — Foreign key → Users.User ID — NOT NULL
- Email (email) — VARCHAR(255), not null — Foreign key → Users.Email — NOT NULL
- Title (title) — VARCHAR(200)
- Content (content) — TEXT
- View Count (view_count) — INT default 0
- Created At (created_at)
- Updated At (updated_at) — DATETIME
Stories (stories)
- Story ID (id) — BIGINT — Primary key — NOT NULL
- User ID (user_id) — users.id — Primary key — NOT NULL
- Posts ID (id2) — BIGINT — Foreign key → Posts.Posts ID — NOT NULL
- Story ID (story_id) — VARCHAR(255), not null — Foreign key → Posts.Story ID — NOT NULL
- User ID (id22) — BIGINT, auto_increment — Foreign key → Posts.User ID — NOT NULL
- Email (email) — VARCHAR(255), not null — Foreign key → Posts.Email — NOT NULL
- Title (title) — VARCHAR(200)
- Content (content) — TEXT — AI 생성 이야기
- Target Age (target_age) — TINYINT (3~10)
- Is Shared (is_shared) — BOOLEAN default false
- Created At (created_at) — DATETIME
- Updated At (updated_at) — DATETIME
Story_Toys (story_toys)
- Story_Toys ID (id) — BIGINT — Primary key — NOT NULL
- Story ID (story_id) — stories.id — Primary key — NOT NULL
- Toy ID (toy_id) — toys.id — Primary key — NOT NULL
- Role (role_in_story) — VARCHAR(100), nullable
Toys (toys)
- Toys ID (id) — BIGINT — Primary key — NOT NULL
- User ID (users.id) — BIGINT, auto_increment — Foreign key → Users.User ID — NOT NULL
- Email (email) — VARCHAR(255), not null — Foreign key → Users.Email — NOT NULL
- Name (name) — VARCHAR(50), not null
- Image URL (image_url) — VARCHAR(500) — S3 경로
- Personality (personality) — TEXT, nullable (null이면 AI 자동생성)
- Description (description) — TEXT, nullable
- Created At (created_at) — DATETIME
Users (users)
- User ID (id) — BIGINT, auto_increment — Primary key — NOT NULL
- Email (email) — VARCHAR(255), not null — Primary key — NOT NULL
- Password (password) — VARCHAR(255), nullable (when Oauth, null)
- Nickname (nickname) — VARCHAR(50), not null
- Profile Image URL (profile_image_url) — VARCHAR(500), nullable
- Provider (provider) — ENUM('LOCAL','GOOGLE')
- Provider ID (Field5) — VARCHAR(255), nullable (Google sub)
- Role (role) — ENUM('USER','ADMIN')
- Created At (created_at) — DATETIME
- Updated At (updated_at) — DATETIME