project-standalo-sonic-cloud/.workflow/versions/v001/contexts/model_album.yml

86 lines
1.7 KiB
YAML

task_id: task_create_model_album
entity_id: model_album
generated_at: '2025-12-18T15:16:50.221462'
workflow_version: v001
target:
type: model
definition:
id: model_album
name: Album
table_name: albums
description: Collection of songs
fields:
- name: id
type: uuid
constraints:
- primary_key
- name: artist_id
type: uuid
constraints:
- not_null
- foreign_key
references: artists.id
- name: title
type: string
constraints:
- not_null
- name: description
type: text
constraints:
- nullable
- name: cover_art_url
type: string
constraints:
- nullable
- name: release_date
type: date
constraints:
- nullable
- name: album_type
type: enum
values:
- album
- ep
- single
default: album
- name: created_at
type: timestamp
constraints:
- not_null
- name: updated_at
type: timestamp
constraints:
- not_null
relations:
- type: belongs_to
to: model_artist
foreign_key: artist_id
- type: has_many
to: model_song
foreign_key: album_id
indexes:
- fields:
- artist_id
- fields:
- release_date
timestamps: true
related:
models: []
apis: []
components: []
dependencies:
entity_ids: []
definitions: []
files:
to_create:
- prisma/schema.prisma
- app/models/album.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