Skip to content

Commit b7a17c6

Browse files
authored
Removed unused columns (#147)
* removed unused cols * added migration
1 parent 95ad37b commit b7a17c6

8 files changed

Lines changed: 41 additions & 46 deletions

File tree

src/app/[org]/[repo]/page/repo-profile-card/actions.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,12 @@ export async function createSubscription(org: string, repo: string) {
5252
const userTimelineEntries = publicEvents.map(
5353
(event: Tables<"public_timeline">) => ({
5454
user_id: userId,
55-
categories: event.categories,
5655
created_at: event.created_at,
5756
data: event.data,
5857
dedupe_hash: event.dedupe_hash,
5958
event_ids: event.event_ids,
60-
is_read: false,
6159
repo_id: event.repo_id,
6260
score: event.score,
63-
snooze_to: event.snooze_to,
6461
type: event.type,
6562
updated_at: new Date().toISOString(),
6663
}),

src/trigger/new-user-signup.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,12 @@ export const newUserSignUpTask = schemaTask({
4646
const userTimelineEntries: TablesInsert<"user_timeline">[] =
4747
publicEvents.map((event) => ({
4848
user_id: userId,
49-
categories: event.categories,
5049
created_at: event.created_at,
5150
data: event.data,
5251
dedupe_hash: event.dedupe_hash,
5352
event_ids: event.event_ids,
54-
is_read: false,
5553
repo_id: event.repo_id,
5654
score: event.score,
57-
snooze_to: event.snooze_to,
5855
type: event.type,
5956
updated_at: new Date().toISOString(),
6057
}));

src/trigger/process-github-events.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,6 @@ export const processGithubEvents = schemaTask({
2929

3030
logger.info(`Processing ${events.length} events for ${org}/${repo}`);
3131

32-
// First, handle any snoozed timeline entries that have reached their time
33-
await Promise.allSettled([
34-
supabase
35-
.from("user_timeline")
36-
.update({ snooze_to: null, updated_at: currentTimestamp })
37-
.not("snooze_to", "is", null)
38-
.lt("snooze_to", currentTimestamp)
39-
.throwOnError(),
40-
supabase
41-
.from("public_timeline")
42-
.update({ snooze_to: null, updated_at: currentTimestamp })
43-
.not("snooze_to", "is", null)
44-
.lt("snooze_to", currentTimestamp)
45-
.throwOnError(),
46-
]);
47-
4832
for (const event of events || []) {
4933
try {
5034
const { data: repo } = await supabase

src/trigger/process-github-events/event-processors/pull-request.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ You can use explore_file with ref=${pull_request.head.sha} to read specific file
313313
dedupe_hash: dedupeHash,
314314
updated_at: pull_request.updated_at.toISOString(),
315315
event_ids: [event.id],
316-
is_read: false,
317316
search_text: [prData.pull_request.title, prData.pull_request.ai_summary]
318317
.filter((text) => text.trim().length > 0)
319318
.join(" "),
@@ -322,7 +321,6 @@ You can use explore_file with ref=${pull_request.head.sha} to read specific file
322321
const userTimelineEntries: TablesInsert<"user_timeline">[] = subscribers.map(
323322
(s) => ({
324323
user_id: s.user_id,
325-
categories: ["pull_requests"],
326324
...timelineEntry,
327325
}),
328326
);

src/trigger/process-github-events/event-processors/push.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ You can use explore_file with ref=${latestCommit.id} to read specific file conte
234234
dedupe_hash: dedupeHash,
235235
updated_at: latestTimestamp,
236236
event_ids: [event.id],
237-
is_read: false,
238237
search_text: [result.title, aiSummary]
239238
.filter((text) => text.trim().length > 0)
240239
.join(" "),
@@ -244,7 +243,6 @@ You can use explore_file with ref=${latestCommit.id} to read specific file conte
244243
const userTimelineEntries: TablesInsert<"user_timeline">[] = subscribers.map(
245244
(s) => ({
246245
user_id: s.user_id,
247-
categories: ["pushes"],
248246
...timelineEntry,
249247
}),
250248
);

src/trigger/process-github-events/event-processors/release.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ You can use explore_file with ref=${release.tag_name} to read files at the relea
149149
updated_at:
150150
release.published_at?.toISOString() || release.created_at.toISOString(),
151151
event_ids: [event.id],
152-
is_read: false,
153152
search_text: [
154153
releaseData.release.name ?? releaseData.release.tag_name,
155154
releaseData.release.ai_summary,
@@ -161,7 +160,6 @@ You can use explore_file with ref=${release.tag_name} to read files at the relea
161160
const userTimelineEntries: TablesInsert<"user_timeline">[] = subscribers.map(
162161
(s) => ({
163162
user_id: s.user_id,
164-
categories: ["releases"],
165163
...timelineEntry,
166164
}),
167165
);

src/types/supabase.ts

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@ export type Json =
77
| Json[];
88

99
export type Database = {
10+
graphql_public: {
11+
Tables: {
12+
[_ in never]: never;
13+
};
14+
Views: {
15+
[_ in never]: never;
16+
};
17+
Functions: {
18+
graphql: {
19+
Args: {
20+
extensions?: Json;
21+
operationName?: string;
22+
query?: string;
23+
variables?: Json;
24+
};
25+
Returns: Json;
26+
};
27+
};
28+
Enums: {
29+
[_ in never]: never;
30+
};
31+
CompositeTypes: {
32+
[_ in never]: never;
33+
};
34+
};
1035
public: {
1136
Tables: {
1237
github_event_log: {
@@ -68,50 +93,41 @@ export type Database = {
6893
};
6994
public_timeline: {
7095
Row: {
71-
categories: string[] | null;
7296
created_at: string;
7397
data: Json;
7498
dedupe_hash: string;
7599
event_ids: string[] | null;
76100
id: string;
77-
is_read: boolean;
78101
repo_id: string;
79102
score: number;
80103
search_text: string | null;
81104
search_vector: unknown;
82-
snooze_to: string | null;
83105
type: string;
84106
updated_at: string;
85107
};
86108
Insert: {
87-
categories?: string[] | null;
88109
created_at?: string;
89110
data: Json;
90111
dedupe_hash: string;
91112
event_ids?: string[] | null;
92113
id?: string;
93-
is_read?: boolean;
94114
repo_id: string;
95115
score: number;
96116
search_text?: string | null;
97117
search_vector?: unknown;
98-
snooze_to?: string | null;
99118
type: string;
100119
updated_at?: string;
101120
};
102121
Update: {
103-
categories?: string[] | null;
104122
created_at?: string;
105123
data?: Json;
106124
dedupe_hash?: string;
107125
event_ids?: string[] | null;
108126
id?: string;
109-
is_read?: boolean;
110127
repo_id?: string;
111128
score?: number;
112129
search_text?: string | null;
113130
search_vector?: unknown;
114-
snooze_to?: string | null;
115131
type?: string;
116132
updated_at?: string;
117133
};
@@ -270,52 +286,43 @@ export type Database = {
270286
};
271287
user_timeline: {
272288
Row: {
273-
categories: string[] | null;
274289
created_at: string;
275290
data: Json;
276291
dedupe_hash: string;
277292
event_ids: string[] | null;
278293
id: string;
279-
is_read: boolean;
280294
repo_id: string;
281295
score: number;
282296
search_text: string | null;
283297
search_vector: unknown;
284-
snooze_to: string | null;
285298
type: string;
286299
updated_at: string;
287300
user_id: string;
288301
};
289302
Insert: {
290-
categories?: string[] | null;
291303
created_at?: string;
292304
data: Json;
293305
dedupe_hash: string;
294306
event_ids?: string[] | null;
295307
id?: string;
296-
is_read?: boolean;
297308
repo_id: string;
298309
score: number;
299310
search_text?: string | null;
300311
search_vector?: unknown;
301-
snooze_to?: string | null;
302312
type: string;
303313
updated_at?: string;
304314
user_id: string;
305315
};
306316
Update: {
307-
categories?: string[] | null;
308317
created_at?: string;
309318
data?: Json;
310319
dedupe_hash?: string;
311320
event_ids?: string[] | null;
312321
id?: string;
313-
is_read?: boolean;
314322
repo_id?: string;
315323
score?: number;
316324
search_text?: string | null;
317325
search_vector?: unknown;
318-
snooze_to?: string | null;
319326
type?: string;
320327
updated_at?: string;
321328
user_id?: string;
@@ -499,6 +506,9 @@ export type CompositeTypes<
499506
: never;
500507

501508
export const Constants = {
509+
graphql_public: {
510+
Enums: {},
511+
},
502512
public: {
503513
Enums: {},
504514
},
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
alter table "public"."public_timeline" drop column "categories";
2+
3+
alter table "public"."public_timeline" drop column "is_read";
4+
5+
alter table "public"."public_timeline" drop column "snooze_to";
6+
7+
alter table "public"."user_timeline" drop column "categories";
8+
9+
alter table "public"."user_timeline" drop column "is_read";
10+
11+
alter table "public"."user_timeline" drop column "snooze_to";
12+
13+

0 commit comments

Comments
 (0)