Files
brand_book/apps/api/prisma/schema.prisma
T
AR 15 M4 e20d222183 feat(sprint-5.5): store block metadata (version, changelog) in PostgreSQL
- Prisma schema: added `changelog Json @default("[]")` to Block model
- Migration: 20260324141120_add_changelog_field
- Seed: 8 blocks with actual versions (v1.0–v1.2) and changelog entries
- API: PATCH /blocks/by-path accepts changelog field
- CORS: accept any localhost port (regex pattern)
- BlockChangelog component: renders version history from API or fallback
- BlockMetaBar: loads changelog from API, passes to BlockChangelog
  - Removed "API офлайн" text, replaced with subtle gray dot
  - Added defaultChangelog prop for offline fallback
- Block pages: removed hardcoded changelog JSX, use defaultChangelog prop
- Updated SPRINTS.md with completed tasks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:21:56 +05:00

53 lines
1.1 KiB
Plaintext

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
}
enum Role {
viewer
editor
}
enum ComponentStatus {
draft
review
approved
}
model User {
id String @id @default(uuid())
email String @unique
name String
passwordHash String
role Role @default(viewer)
createdAt DateTime @default(now())
components ExperimentalComponent[]
}
model ExperimentalComponent {
id String @id @default(uuid())
name String
baseComponent String
attributes Json
status ComponentStatus @default(draft)
author User @relation(fields: [authorId], references: [id])
authorId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Block {
id String @id @default(uuid())
path String @unique
name String
version String
isInPreview Boolean @default(false)
changelog Json @default("[]")
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
}