Skip to content

Commit

Permalink
Pinned posts
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Jun 25, 2024
1 parent cf645c9 commit b74a888
Show file tree
Hide file tree
Showing 19 changed files with 2,982 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"cSpell.words": [
"activitypub",
"bigserial",
"biomejs",
"blurhash",
"bunx",
Expand All @@ -36,6 +37,7 @@
"fedi",
"fedify",
"fediverse",
"fkey",
"hono",
"htmls",
"ilike",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Current features and roadmap
- [x] View posts
- [x] Post visibility
- [x] Post language
- [ ] Pinned posts
- [x] Pinned posts
- [x] Mentions
- [x] Hashtags
- [x] Media attachments
Expand Down
Binary file modified bun.lockb
Binary file not shown.
21 changes: 21 additions & 0 deletions drizzle/0024_pinned_posts.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE TABLE IF NOT EXISTS "pinned_posts" (
"index" bigserial PRIMARY KEY NOT NULL,
"post_id" uuid NOT NULL,
"account_id" uuid NOT NULL,
"created" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "pinned_posts_post_id_account_id_unique" UNIQUE("post_id","account_id")
);
--> statement-breakpoint
ALTER TABLE "posts" ADD CONSTRAINT "posts_id_actor_id_unique" UNIQUE("id", "actor_id");
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "pinned_posts" ADD CONSTRAINT "pinned_posts_account_id_accounts_id_fk" FOREIGN KEY ("account_id") REFERENCES "public"."accounts"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "pinned_posts" ADD CONSTRAINT "pinned_posts_post_id_account_id_posts_id_actor_id_fk" FOREIGN KEY ("post_id","account_id") REFERENCES "public"."posts"("id","actor_id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
1 change: 1 addition & 0 deletions drizzle/0025_accounts.featured_url.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "accounts" ADD COLUMN "featured_url" text;
Loading

0 comments on commit b74a888

Please sign in to comment.