mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(database): 🚚 Rename "Attachment" to "Media"
This commit is contained in:
parent
bbd56b600d
commit
2f61cd8f0a
21 changed files with 2429 additions and 101 deletions
|
|
@ -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)),
|
||||
)}`,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue