Skip to content

Commit

Permalink
changed my mind, including instance in response is redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellerb committed Apr 14, 2024
1 parent eef2d2c commit b83f9bd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions migrations/20240414001416_no_response_instance.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE responses DROP COLUMN instance;
1 change: 0 additions & 1 deletion routes/[slug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export const handler: Handlers<Data, State> = {
}

const response = new FormResponse(
ctx.state.instance.id,
ctx.state.form.id,
ctx.state.user.id,
ctx.state.user.username,
Expand Down
4 changes: 0 additions & 4 deletions utils/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ export class Form extends Entity {
export class FormResponse extends Entity {
@column("id")
id: string;
@column("instance")
instance: string;
@column("date")
date: Date;
@column("form")
Expand All @@ -176,15 +174,13 @@ export class FormResponse extends Entity {
response?: Record<string, string> | null;

constructor(
instance: string,
form: string,
discordId: bigint,
discordName: string,
response?: Record<string, string>,
) {
super();
this.id = crypto.randomUUID();
this.instance = instance;
this.date = new Date();
this.form = form;
this.discordId = discordId;
Expand Down

0 comments on commit b83f9bd

Please sign in to comment.