mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-15 13:25:44 +01:00
31c73fdfa2
* chore: remove default null null is always the default value if a table column is nullable, and typeorm's @Column only accepts strings for default. * chore: synchronize code with database schema * chore: sync generated migrations with code
58 lines
1 KiB
TypeScript
58 lines
1 KiB
TypeScript
import { PrimaryColumn, Entity, Index, Column } from 'typeorm';
|
|
import { id } from '../id.js';
|
|
|
|
@Entity()
|
|
@Index(['name', 'host'], { unique: true })
|
|
export class Emoji {
|
|
@PrimaryColumn(id())
|
|
public id: string;
|
|
|
|
@Column('timestamp with time zone', {
|
|
nullable: true,
|
|
})
|
|
public updatedAt: Date | null;
|
|
|
|
@Index()
|
|
@Column('varchar', {
|
|
length: 128,
|
|
})
|
|
public name: string;
|
|
|
|
@Index()
|
|
@Column('varchar', {
|
|
length: 128, nullable: true,
|
|
})
|
|
public host: string | null;
|
|
|
|
@Column('varchar', {
|
|
length: 128, nullable: true,
|
|
})
|
|
public category: string | null;
|
|
|
|
@Column('varchar', {
|
|
length: 512,
|
|
})
|
|
public originalUrl: string;
|
|
|
|
@Column('varchar', {
|
|
length: 512,
|
|
default: '',
|
|
})
|
|
public publicUrl: string;
|
|
|
|
@Column('varchar', {
|
|
length: 512, nullable: true,
|
|
})
|
|
public uri: string | null;
|
|
|
|
// publicUrlの方のtypeが入る
|
|
@Column('varchar', {
|
|
length: 64, nullable: true,
|
|
})
|
|
public type: string | null;
|
|
|
|
@Column('varchar', {
|
|
array: true, length: 128, default: '{}',
|
|
})
|
|
public aliases: string[];
|
|
}
|