refactor(database): 🚚 Rename "Attachment" to "Media"

This commit is contained in:
Jesse Wierzbinski 2025-01-23 16:08:42 +01:00
parent bbd56b600d
commit 2f61cd8f0a
No known key found for this signature in database
21 changed files with 2429 additions and 101 deletions

View file

@ -1,5 +1,5 @@
import { Args } from "@oclif/core";
import { Attachment, Emoji } from "@versia/kit/db";
import { Emoji, Media } from "@versia/kit/db";
import { Emojis } from "@versia/kit/tables";
import chalk from "chalk";
import { and, eq, isNull } from "drizzle-orm";
@ -115,7 +115,7 @@ export default class EmojiAdd extends BaseCommand<typeof EmojiAdd> {
await Emoji.insert({
shortcode: args.shortcode,
url: Attachment.getUrl(uploaded.path),
url: Media.getUrl(uploaded.path),
visibleInPicker: true,
contentType: uploaded.uploadedFile.type,
});
@ -124,7 +124,7 @@ export default class EmojiAdd extends BaseCommand<typeof EmojiAdd> {
`${chalk.green("✓")} Created emoji ${chalk.green(
args.shortcode,
)} with url ${chalk.blue(
chalk.underline(Attachment.getUrl(uploaded.path)),
chalk.underline(Media.getUrl(uploaded.path)),
)}`,
);

View file

@ -1,5 +1,5 @@
import { Args, Flags } from "@oclif/core";
import { Attachment, Emoji } from "@versia/kit/db";
import { Emoji, Media } from "@versia/kit/db";
import { Emojis } from "@versia/kit/tables";
import chalk from "chalk";
import { and, inArray, isNull } from "drizzle-orm";
@ -214,7 +214,7 @@ export default class EmojiImport extends BaseCommand<typeof EmojiImport> {
await Emoji.insert({
shortcode: emoji.emoji.name,
url: Attachment.getUrl(uploaded.path),
url: Media.getUrl(uploaded.path),
visibleInPicker: true,
contentType: uploaded.uploadedFile.type,
});