Skip to content

Commit

Permalink
wip: dbスキーマ
Browse files Browse the repository at this point in the history
  • Loading branch information
Esurio committed Aug 6, 2024
1 parent ebc6ec1 commit 5f5555c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/backend/src/core/entities/NoteEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ export class NoteEntityService implements OnModuleInit {
poll: note.hasPoll ? this.populatePoll(note, meId) : undefined,
event: note.hasEvent ? this.populateEvent(note) : undefined,
deleteAt: note.deleteAt?.toISOString() ?? undefined,
scheduledAt: note.scheduledAt == null ? undefined : typeof note.scheduledAt === 'string' ? note.scheduledAt : note.scheduledAt.toISOString(),

...(meId && Object.keys(note.reactions).length > 0 ? {
myReaction: this.populateMyReaction(note, meId, options?._hint_),
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/models/Note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ export class MiNote {
})
public deleteAt: Date | null;

@Column('timestamp with time zone', {
nullable: true,
})
public scheduledAt: Date | null;

@Index()
@Column({
...id(),
Expand Down
3 changes: 0 additions & 3 deletions packages/backend/src/models/_.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import { MiPromoRead } from '@/models/PromoRead.js';
import { MiRegistrationTicket } from '@/models/RegistrationTicket.js';
import { MiRegistryItem } from '@/models/RegistryItem.js';
import { MiRelay } from '@/models/Relay.js';
import { MiScheduledNote } from '@/models/ScheduledNote.js';
import { MiSignin } from '@/models/Signin.js';
import { MiSwSubscription } from '@/models/SwSubscription.js';
import { MiUsedUsername } from '@/models/UsedUsername.js';
Expand Down Expand Up @@ -179,7 +178,6 @@ export {
MiRegistrationTicket,
MiRegistryItem,
MiRelay,
MiScheduledNote,
MiSignin,
MiSwSubscription,
MiUsedUsername,
Expand Down Expand Up @@ -257,7 +255,6 @@ export type PromoReadsRepository = Repository<MiPromoRead> & MiRepository<MiProm
export type RegistrationTicketsRepository = Repository<MiRegistrationTicket> & MiRepository<MiRegistrationTicket>;
export type RegistryItemsRepository = Repository<MiRegistryItem> & MiRepository<MiRegistryItem>;
export type RelaysRepository = Repository<MiRelay> & MiRepository<MiRelay>;
export type ScheduledNotesRepository = Repository<MiScheduledNote> & MiRepository<MiScheduledNote>;
export type SigninsRepository = Repository<MiSignin> & MiRepository<MiSignin>;
export type SwSubscriptionsRepository = Repository<MiSwSubscription> & MiRepository<MiSwSubscription>;
export type UsedUsernamesRepository = Repository<MiUsedUsername> & MiRepository<MiUsedUsername>;
Expand Down

0 comments on commit 5f5555c

Please sign in to comment.