1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2025-01-10 11:53:11 +09:00
cherrypick/packages/backend/src/models/AvatarDecoration.ts
caipira113 d32ad30e8e Fix Endpoint: admin/avatar-decorations/create
Info: {"e":{"message":"null value in column \"remoteId\" of relation \"avatar_decoration\" violates not-null constraint","code":"QueryFailedError","id":"2837d39d-37ea-4633-979a-fb8de2741b3e"}}
2023-11-21 16:05:41 +09:00

50 lines
1.0 KiB
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and other misskey, cherrypick contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from 'typeorm';
import { id } from './util/id.js';
@Entity('avatar_decoration')
export class MiAvatarDecoration {
@PrimaryColumn(id())
public id: string;
@Column('timestamp with time zone', {
nullable: true,
})
public updatedAt: Date | null;
@Column('varchar', {
length: 1024,
})
public url: string;
@Column('varchar', {
length: 256,
})
public name: string;
@Column('varchar', {
length: 2048,
})
public description: string;
// TODO: 定期ジョブで存在しなくなったロールIDを除去するようにする
@Column('varchar', {
array: true, length: 128, default: '{}',
})
public roleIdsThatCanBeUsedThisDecoration: string[];
@Column('varchar', {
length: 32, nullable: true,
})
public remoteId: string | null;
@Column('varchar', {
length: 128, nullable: true,
})
public host: string | null;
}