Skip to content

Commit d6b2d64

Browse files
Small performance improvements (#100)
1 parent 4ae67ce commit d6b2d64

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

apps/web/components/most-helpful.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const MostHelpful = async () => {
4141
<Link
4242
className="opacity-90 text-white line-clamp-1 max-w-[200px]"
4343
href={`/user/${user.userID}`}
44+
prefetch={false}
4445
>
4546
{user.username}
4647
</Link>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { Kysely } from 'kysely'
2+
3+
export async function up(db: Kysely<any>): Promise<void> {
4+
await db.schema
5+
.alterTable('attachments')
6+
.alterColumn('messageId', (col) => col.setDataType('text'))
7+
.alterColumn('snowflakeId', (col) => col.setDataType('text'))
8+
.execute()
9+
10+
await db.schema
11+
.alterTable('channels')
12+
.alterColumn('snowflakeId', (col) => col.setDataType('text'))
13+
.execute()
14+
15+
await db.schema
16+
.alterTable('messages')
17+
.alterColumn('postId', (col) => col.setDataType('text'))
18+
.alterColumn('replyToMessageId', (col) => col.setDataType('text'))
19+
.alterColumn('snowflakeId', (col) => col.setDataType('text'))
20+
.alterColumn('userId', (col) => col.setDataType('text'))
21+
.execute()
22+
23+
await db.schema
24+
.alterTable('posts')
25+
.alterColumn('answerId', (col) => col.setDataType('text'))
26+
.alterColumn('channelId', (col) => col.setDataType('text'))
27+
.alterColumn('snowflakeId', (col) => col.setDataType('text'))
28+
.alterColumn('userId', (col) => col.setDataType('text'))
29+
.execute()
30+
31+
await db.schema
32+
.alterTable('users')
33+
.alterColumn('discriminator', (col) => col.setDataType('text'))
34+
.alterColumn('snowflakeId', (col) => col.setDataType('text'))
35+
.execute()
36+
}
37+
38+
export async function down(db: Kysely<any>): Promise<void> {
39+
await db.schema
40+
.alterTable('attachments')
41+
.alterColumn('messageId', (col) => col.setDataType('varchar(40)'))
42+
.alterColumn('snowflakeId', (col) => col.setDataType('varchar(40)'))
43+
.execute()
44+
45+
await db.schema
46+
.alterTable('channels')
47+
.alterColumn('snowflakeId', (col) => col.setDataType('varchar(40)'))
48+
.execute()
49+
50+
await db.schema
51+
.alterTable('messages')
52+
.alterColumn('postId', (col) => col.setDataType('varchar(40)'))
53+
.alterColumn('replyToMessageId', (col) => col.setDataType('varchar(40)'))
54+
.alterColumn('snowflakeId', (col) => col.setDataType('varchar(40)'))
55+
.alterColumn('userId', (col) => col.setDataType('varchar(40)'))
56+
.execute()
57+
58+
await db.schema
59+
.alterTable('posts')
60+
.alterColumn('answerId', (col) => col.setDataType('varchar(40)'))
61+
.alterColumn('channelId', (col) => col.setDataType('varchar(40)'))
62+
.alterColumn('snowflakeId', (col) => col.setDataType('varchar(40)'))
63+
.alterColumn('userId', (col) => col.setDataType('varchar(40)'))
64+
.execute()
65+
66+
await db.schema
67+
.alterTable('users')
68+
.alterColumn('discriminator', (col) => col.setDataType('varchar(4)'))
69+
.alterColumn('snowflakeId', (col) => col.setDataType('varchar(40)'))
70+
.execute()
71+
}

0 commit comments

Comments
 (0)