78 lines
1.6 KiB
YAML
78 lines
1.6 KiB
YAML
task_id: task_create_model_playlist
|
|
entity_id: model_playlist
|
|
generated_at: '2025-12-18T15:16:50.224750'
|
|
workflow_version: v001
|
|
target:
|
|
type: model
|
|
definition:
|
|
id: model_playlist
|
|
name: Playlist
|
|
table_name: playlists
|
|
description: User-created song collection
|
|
fields:
|
|
- name: id
|
|
type: uuid
|
|
constraints:
|
|
- primary_key
|
|
- name: user_id
|
|
type: uuid
|
|
constraints:
|
|
- not_null
|
|
- foreign_key
|
|
references: users.id
|
|
- name: name
|
|
type: string
|
|
constraints:
|
|
- not_null
|
|
- name: description
|
|
type: text
|
|
constraints:
|
|
- nullable
|
|
- name: cover_image_url
|
|
type: string
|
|
constraints:
|
|
- nullable
|
|
- name: is_public
|
|
type: boolean
|
|
default: false
|
|
- name: created_at
|
|
type: timestamp
|
|
constraints:
|
|
- not_null
|
|
- name: updated_at
|
|
type: timestamp
|
|
constraints:
|
|
- not_null
|
|
relations:
|
|
- type: belongs_to
|
|
to: model_user
|
|
foreign_key: user_id
|
|
- type: has_many
|
|
to: model_playlist_song
|
|
foreign_key: playlist_id
|
|
indexes:
|
|
- fields:
|
|
- user_id
|
|
- fields:
|
|
- is_public
|
|
timestamps: true
|
|
related:
|
|
models: []
|
|
apis: []
|
|
components: []
|
|
dependencies:
|
|
entity_ids: []
|
|
definitions: []
|
|
files:
|
|
to_create:
|
|
- prisma/schema.prisma
|
|
- app/models/playlist.ts
|
|
reference: []
|
|
acceptance:
|
|
- criterion: Model defined in Prisma schema
|
|
verification: Check prisma/schema.prisma
|
|
- criterion: TypeScript types exported
|
|
verification: Import type in test file
|
|
- criterion: Relations properly configured
|
|
verification: Check Prisma relations
|