Skip to content

Commit

Permalink
POST /api/v2/media
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Jun 14, 2024
1 parent d3f88d4 commit 5a6aa71
Show file tree
Hide file tree
Showing 22 changed files with 1,558 additions and 469 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Current features and roadmap
- [ ] Pinned posts
- [x] Mentions
- [x] Hashtags
- [ ] Images
- [x] Media attachments
- [ ] Polls
- [x] Likes (favorites)
- [x] Shares (reblogs)
Expand Down
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"recommended": true,
"correctness": {
"useJsxKeyInIterable": "off"
},
"style": {
"noNonNullAssertion": "off"
}
}
}
Expand Down
Binary file modified bun.lockb
Binary file not shown.
20 changes: 20 additions & 0 deletions drizzle/0022_media.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CREATE TABLE IF NOT EXISTS "media" (
"id" uuid PRIMARY KEY NOT NULL,
"post_id" uuid,
"type" text NOT NULL,
"url" text NOT NULL,
"width" integer NOT NULL,
"height" integer NOT NULL,
"description" text,
"thumbnail_type" text NOT NULL,
"thumbnail_url" text NOT NULL,
"thumbnail_width" integer NOT NULL,
"thumbnail_height" integer NOT NULL,
"created" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "media" ADD CONSTRAINT "media_post_id_posts_id_fk" FOREIGN KEY ("post_id") REFERENCES "public"."posts"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
Loading

0 comments on commit 5a6aa71

Please sign in to comment.