mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(database): ♻️ Use ContentFormat to store media data
This commit is contained in:
parent
2f61cd8f0a
commit
9c30dacda7
7 changed files with 227 additions and 132 deletions
|
|
@ -305,18 +305,10 @@ export const Tokens = pgTable("Tokens", {
|
|||
|
||||
export const Medias = pgTable("Medias", {
|
||||
id: id(),
|
||||
url: text("url").notNull(),
|
||||
remoteUrl: text("remote_url"),
|
||||
thumbnailUrl: text("thumbnail_url"),
|
||||
mimeType: text("mime_type").notNull(),
|
||||
description: text("description"),
|
||||
content: jsonb("content").notNull().$type<ContentFormat>(),
|
||||
originalContent: jsonb("original_content").$type<ContentFormat>(),
|
||||
thumbnail: jsonb("thumbnail").$type<ContentFormat>(),
|
||||
blurhash: text("blurhash"),
|
||||
sha256: text("sha256"),
|
||||
fps: integer("fps"),
|
||||
duration: integer("duration"),
|
||||
width: integer("width"),
|
||||
height: integer("height"),
|
||||
size: integer("size"),
|
||||
noteId: uuid("noteId").references(() => Notes.id, {
|
||||
onDelete: "cascade",
|
||||
onUpdate: "cascade",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue