refactor: rename instance.caughtAt to instance.firstRetrievedAt

This commit is contained in:
syuilo 2023-01-16 05:02:38 +09:00
parent 7e5f3dbf11
commit 30fced38c4
10 changed files with 23 additions and 11 deletions

View file

@ -64,6 +64,7 @@ You should also include the user name that made the change.
- API: `user`および`note`エンティティに`emojis`プロパティが含まれなくなりました
- API: `user`エンティティに`avatarColor`および`bannerColor`プロパティが含まれなくなりました
- API: `instance`エンティティに`latestStatus`、`lastCommunicatedAt`、`latestRequestSentAt`プロパティが含まれなくなりました
- API: `instance`エンティティの`caughtAt`は`firstRetrievedAt`に名前が変わりました
### Improvements
- Role system @syuilo

View file

@ -0,0 +1,11 @@
export class firstRetrievedAt1673812883772 {
name = 'firstRetrievedAt1673812883772'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "instance" RENAME COLUMN "caughtAt" TO "firstRetrievedAt"`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "instance" RENAME COLUMN "firstRetrievedAt" TO "caughtAt"`);
}
}

View file

@ -34,7 +34,7 @@ export class FederatedInstanceService {
const i = await this.instancesRepository.insert({
id: this.idService.genId(),
host,
caughtAt: new Date(),
firstRetrievedAt: new Date(),
}).then(x => this.instancesRepository.findOneByOrFail(x.identifiers[0]));
this.cache.set(host, i);

View file

@ -29,7 +29,7 @@ export class InstanceEntityService {
const meta = await this.metaService.fetch();
return {
id: instance.id,
caughtAt: instance.caughtAt.toISOString(),
firstRetrievedAt: instance.firstRetrievedAt.toISOString(),
host: instance.host,
usersCount: instance.usersCount,
notesCount: instance.notesCount,

View file

@ -13,7 +13,7 @@ export class Instance {
@Column('timestamp with time zone', {
comment: 'The caught date of the Instance.',
})
public caughtAt: Date;
public firstRetrievedAt: Date;
/**
*

View file

@ -6,7 +6,7 @@ export const packedFederationInstanceSchema = {
optional: false, nullable: false,
format: 'id',
},
caughtAt: {
firstRetrievedAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',

View file

@ -63,8 +63,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
case '-following': query.orderBy('instance.followingCount', 'ASC'); break;
case '+followers': query.orderBy('instance.followersCount', 'DESC'); break;
case '-followers': query.orderBy('instance.followersCount', 'ASC'); break;
case '+caughtAt': query.orderBy('instance.caughtAt', 'DESC'); break;
case '-caughtAt': query.orderBy('instance.caughtAt', 'ASC'); break;
case '+firstRetrievedAt': query.orderBy('instance.firstRetrievedAt', 'DESC'); break;
case '-firstRetrievedAt': query.orderBy('instance.firstRetrievedAt', 'ASC'); break;
case '+latestRequestReceivedAt': query.orderBy('instance.latestRequestReceivedAt', 'DESC', 'NULLS LAST'); break;
case '-latestRequestReceivedAt': query.orderBy('instance.latestRequestReceivedAt', 'ASC', 'NULLS FIRST'); break;

View file

@ -28,8 +28,8 @@
<option value="-following">{{ i18n.ts.following }} ({{ i18n.ts.ascendingOrder }})</option>
<option value="+followers">{{ i18n.ts.followers }} ({{ i18n.ts.descendingOrder }})</option>
<option value="-followers">{{ i18n.ts.followers }} ({{ i18n.ts.ascendingOrder }})</option>
<option value="+caughtAt">{{ i18n.ts.registeredAt }} ({{ i18n.ts.descendingOrder }})</option>
<option value="-caughtAt">{{ i18n.ts.registeredAt }} ({{ i18n.ts.ascendingOrder }})</option>
<option value="+firstRetrievedAt">{{ i18n.ts.registeredAt }} ({{ i18n.ts.descendingOrder }})</option>
<option value="-firstRetrievedAt">{{ i18n.ts.registeredAt }} ({{ i18n.ts.ascendingOrder }})</option>
</MkSelect>
</FormSplit>
</div>

View file

@ -32,8 +32,8 @@
<option value="-following">{{ i18n.ts.following }} ({{ i18n.ts.ascendingOrder }})</option>
<option value="+followers">{{ i18n.ts.followers }} ({{ i18n.ts.descendingOrder }})</option>
<option value="-followers">{{ i18n.ts.followers }} ({{ i18n.ts.ascendingOrder }})</option>
<option value="+caughtAt">{{ i18n.ts.registeredAt }} ({{ i18n.ts.descendingOrder }})</option>
<option value="-caughtAt">{{ i18n.ts.registeredAt }} ({{ i18n.ts.ascendingOrder }})</option>
<option value="+firstRetrievedAt">{{ i18n.ts.registeredAt }} ({{ i18n.ts.descendingOrder }})</option>
<option value="-firstRetrievedAt">{{ i18n.ts.registeredAt }} ({{ i18n.ts.ascendingOrder }})</option>
</MkSelect>
</FormSplit>
</div>

View file

@ -38,7 +38,7 @@
<FormSection>
<MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ i18n.ts.registeredAt }}</template>
<template #value><MkTime mode="detail" :time="instance.caughtAt"/></template>
<template #value><MkTime mode="detail" :time="instance.firstRetrievedAt"/></template>
</MkKeyValue>
<MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ i18n.ts.updatedAt }}</template>