Skip to content
Merged

Dev #14

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
5d9bf42
Add comprehensive styles for various components and layouts
shoaibsharif Mar 19, 2025
d7b17c9
Refactor code structure for improved readability and maintainability
shoaibsharif Mar 19, 2025
af32680
Update TypeScript configuration and refactor dashboard components
kingRayhan Mar 19, 2025
fca8ca8
Refactor layout and home components for improved structure
kingRayhan Mar 19, 2025
afa677a
Update dependencies and enhance styles for improved UI
kingRayhan Mar 19, 2025
29b674b
Enhance configuration and refactor components for improved functionality
kingRayhan Mar 19, 2025
5f379f8
Remove unused components, models, and utilities to streamline the cod…
kingRayhan Mar 19, 2025
eb6bad3
Refactor layout and page components for improved structure and styling
kingRayhan Mar 20, 2025
223c532
Update dependencies and refactor styles for improved UI and functiona…
kingRayhan Mar 20, 2025
05302fb
Refactor Navbar and ThemeSwitcher components for improved UI and func…
kingRayhan Mar 20, 2025
77e0b29
Enhance application structure and UI components
kingRayhan Mar 20, 2025
cb6a45a
Remove unused authentication schema and migration files
kingRayhan Mar 20, 2025
2594a4d
Refactor NavbarActions and ThemeSwitcher components for improved func…
kingRayhan Mar 20, 2025
43fdf9f
Remove unused page component and layout styles to streamline the code…
kingRayhan Mar 20, 2025
b1f7a26
Add Radix UI Dialog component and enhance HomeLeftSidebar layout
kingRayhan Mar 20, 2025
8c1eb11
Enhance SearchInput component with translation support
kingRayhan Mar 20, 2025
3f1007f
Update environment variables, enhance database configuration, and ref…
kingRayhan Mar 22, 2025
8cc9b55
Refactor session management and update user model for improved functi…
kingRayhan Mar 22, 2025
d97202c
Update bun.lock for dependency versioning and add VSCode launch confi…
shoaibsharif Mar 22, 2025
d282822
Merge branch 'upgrade' of github.com:techdiary-dev/techdiary.dev-next…
shoaibsharif Mar 22, 2025
0fa859c
Remove obsolete trace file from backend directory to streamline proje…
kingRayhan Mar 22, 2025
9619660
Refactor session handling and improve query conditions
kingRayhan Mar 22, 2025
5266c11
Update database configuration, rename profilePhoto column, and add mi…
shoaibsharif Mar 22, 2025
d97a7a4
upgrade
kingRayhan Mar 22, 2025
05d7175
Merge branch 'upgrade' of github.com:techdiary-dev/techdiary.dev-next…
kingRayhan Mar 22, 2025
c5857d2
Update dependencies, enhance session management, and refactor components
kingRayhan Mar 22, 2025
eb4dc63
Co-authored-by: Shoaib Sharif <shoaibsharif-dbp@users.noreply.github.…
kingRayhan Mar 22, 2025
6108fb6
Fix: handle empty columns in query by defaulting to "*"
kingRayhan Mar 22, 2025
5e24602
Refactor: streamline todo list by consolidating tasks and removing co…
kingRayhan Mar 22, 2025
e8d6b8a
Enhance todo list functionality by adding filtering options and impro…
kingRayhan Mar 22, 2025
1c74038
Refactor GitHub authentication flow and update dependencies
kingRayhan Mar 23, 2025
e6c4efe
Improve error handling in GitHub callback route
kingRayhan Mar 23, 2025
f914754
Update GitHub authentication flow and add Prettier dependency
kingRayhan Mar 23, 2025
bef5e34
Refactor persistence layer by consolidating database driver imports
kingRayhan Mar 23, 2025
571842d
Remove session retrieval and debug output from home page component
kingRayhan Mar 23, 2025
e114a4d
Add migrations for articles and comments schema updates
kingRayhan Mar 23, 2025
c59d83e
Add Article model and repository with CRUD operations
kingRayhan Mar 23, 2025
34bff61
Add deleteArticle and findRecentArticles methods to ArticleRepository
kingRayhan Mar 23, 2025
74a5360
Fetch and display articles on the home page with pagination
kingRayhan Mar 23, 2025
be34cf3
Fetch articles for the home page layout
kingRayhan Mar 23, 2025
3274f09
Enhance article fetching with pagination and join support
kingRayhan Mar 24, 2025
e62dcab
Refactor home page to utilize ArticleFeed component and remove unused…
kingRayhan Mar 24, 2025
18e826b
Implement ArticleCard component in ArticleFeed for enhanced article d…
kingRayhan Mar 24, 2025
d90fa8a
Enhance ArticleCard component with localization support for publicati…
kingRayhan Mar 24, 2025
b6460d0
Add loading skeletons to ArticleFeed for improved user experience
kingRayhan Mar 24, 2025
c6ae7fb
Enhance ArticleCard and ArticleFeed components with article handle an…
kingRayhan Mar 24, 2025
07d6b07
Refactor ArticleFeed to support infinite scrolling and enhance articl…
kingRayhan Mar 24, 2025
f4ae53e
Remove bun.lock and bun.lockb files; update package-lock.json and pac…
kingRayhan Mar 24, 2025
97ea413
Enhance HomeRightSidebar with new widgets and update user input schema
kingRayhan Mar 24, 2025
d8764b3
Add FakeEditor component to home page and import editor styles
kingRayhan Mar 24, 2025
bc8d99a
Update package dependencies and enhance ArticleFeed component
kingRayhan Mar 24, 2025
37a7597
Remove .env file and update techdiary-drizzle.sql with new user sessi…
kingRayhan Mar 24, 2025
18f77e4
Remove package-lock.json to streamline dependency management and redu…
kingRayhan Mar 24, 2025
e9f6ee7
Enhance article display in page.tsx and update styles
kingRayhan Mar 25, 2025
8260007
Enhance article page layout and user information display
kingRayhan Mar 25, 2025
a94bd45
Refactor content-typography styles for improved readability and consi…
kingRayhan Mar 25, 2025
46f91ae
Implement article not found handling and enhance article page layout
kingRayhan Mar 25, 2025
463ee8c
Add session handling to home page and display user session data
kingRayhan Mar 25, 2025
b7f704f
Update session retrieval in home page to use async/await for improved…
kingRayhan Mar 25, 2025
c6e9427
Remove session retrieval and display from home page for debugging pur…
kingRayhan Mar 25, 2025
a626c87
Update metadata structure across layout and pages for consistency
kingRayhan Mar 25, 2025
4ba433e
Update layout metadata for improved SEO and application details
kingRayhan Mar 27, 2025
b626b41
Update Open Graph image for enhanced social media sharing
kingRayhan Mar 27, 2025
82a1974
Add limit to article detail query for optimized data retrieval
kingRayhan Mar 27, 2025
fe961c1
Remove drizzle-kit dependency from package.json and enhance app.css w…
kingRayhan Mar 27, 2025
25689fc
Update dependencies and enhance dashboard layout
kingRayhan Mar 27, 2025
7178166
Implement session validation in dashboard layout
kingRayhan Mar 27, 2025
1317d3c
Refactor home page component and clean up social links widget
kingRayhan Mar 27, 2025
6946472
Merge branch 'upgrade' of github.com:techdiary-dev/techdiary.dev-next…
kingRayhan Mar 27, 2025
6307f1a
Update package.json to include drizzle-kit dependency and update bun.…
kingRayhan Mar 28, 2025
8009387
Refactor authentication flow and enhance error handling
kingRayhan Mar 28, 2025
13a817c
Remove unused import from GitHub authentication route
kingRayhan Mar 28, 2025
822ff90
Refactor error page component to remove unused translation and simpli…
kingRayhan Mar 28, 2025
0213a94
Refactor dashboard layout and sidebar components for improved functio…
kingRayhan Mar 28, 2025
c191714
Enhance DashboardScaffold and Sidebar components with tooltip functio…
kingRayhan Mar 28, 2025
a1c904f
Update getAfterAuthRedirect function to handle 'null' string value
kingRayhan Mar 28, 2025
d2603a4
Update login page and social login card for improved clarity and styling
kingRayhan Mar 28, 2025
d5f643e
Update login page text and add Bengali translations
kingRayhan Mar 28, 2025
ff2bee7
Update dashboard page to integrate ViewsChart component and add recha…
kingRayhan Mar 28, 2025
78e4832
Enhance dashboard layout and localization support
kingRayhan Mar 28, 2025
f554064
Refactor ArticleFeed component and enhance session management
kingRayhan Mar 28, 2025
6d4bde7
Enhance ArticleList component with improved pagination and loading state
kingRayhan Mar 28, 2025
7640797
Refactor ArticleList component and enhance article actions
kingRayhan Mar 28, 2025
c094209
Update ArticleList component for unpublishing articles and improve lo…
kingRayhan Mar 28, 2025
d53945d
Update package-lock.json to include new SWC binaries for various plat…
kingRayhan Mar 28, 2025
9a07f64
Remove package-lock.json file to streamline dependency management and…
kingRayhan Mar 28, 2025
416dce6
Remove user profile page and update ArticleCard component link format
kingRayhan Mar 28, 2025
226ea1a
Enhance user profile page with detailed information display
kingRayhan Mar 28, 2025
862c357
Enhance user profile page navigation and update editor styles
kingRayhan Mar 28, 2025
f895648
Enhance error handling and user profile page structure
kingRayhan Mar 29, 2025
bc77245
Enhance user profile page with new features and improved layout
kingRayhan Mar 29, 2025
458bcba
Update typography styles for improved content presentation
kingRayhan Mar 29, 2025
7cd5293
Refactor user profile page layout and enhance username handling
kingRayhan Mar 29, 2025
481d062
Implement user article feed and enhance article pagination logic
kingRayhan Mar 29, 2025
a925e41
Add LanguageSwitcher component to DashboardScaffold and NavbarActions
kingRayhan Mar 29, 2025
b0af314
Refactor LanguageSwitcher component to remove unused translation func…
kingRayhan Mar 29, 2025
6bfc266
Enhance MatrixReport component with data fetching and loading state
kingRayhan Mar 29, 2025
f8f8a33
Update MatrixReport component styles for improved loading state prese…
kingRayhan Mar 29, 2025
26791c1
Enhance dashboard layout and article management functionality
kingRayhan Mar 29, 2025
1a4046d
Update dashboard pages to include feature notice and icon
kingRayhan Mar 29, 2025
48126e9
Enhance ArticleList component and backend article filtering
kingRayhan Mar 29, 2025
eb3e5ee
Update SettingsPage to implement tabbed navigation and add new Radix …
kingRayhan Mar 29, 2025
e655ed0
Update configuration and enhance session management features
kingRayhan Mar 30, 2025
ad5da32
Refactor session management by consolidating session actions and remo…
kingRayhan Mar 30, 2025
86f8546
Increase token length in createLoginSession for enhanced security
kingRayhan Mar 30, 2025
ebb81dd
Refactor GitHub callback route and session actions by removing unused…
kingRayhan Mar 30, 2025
9f5f71d
Refactor session handling in dashboard layout component
kingRayhan Mar 30, 2025
2974379
Remove deprecated SessionProvider and test page components; update se…
kingRayhan Mar 30, 2025
bd6745e
Enhance session management by updating device information and adding …
kingRayhan Mar 30, 2025
e42aab7
Implement session management UI with session revocation feature and u…
kingRayhan Mar 30, 2025
e279b55
Update DashboardSidebar component: change session title to "Login Ses…
kingRayhan Mar 30, 2025
ceea906
Add article detail retrieval by UUID and implement article editor com…
kingRayhan Mar 30, 2025
1d52f25
Refactor article retrieval to ensure user authorization and initializ…
kingRayhan Mar 30, 2025
0f242ab
Remove unused columns from article retrieval query in dashboard editor
kingRayhan Mar 30, 2025
6562acc
Add custom hooks for debounced callback and click away detection; imp…
kingRayhan Mar 31, 2025
68ff008
Refactor ArticleEditor: increase debounce time for title and body sav…
kingRayhan Mar 31, 2025
caa1cd3
Enhance ArticleEditor: add language support for formatted time displa…
kingRayhan Apr 1, 2025
f787a36
Refactor ArticleEditor: integrate bodyRef for markdown editor; update…
kingRayhan Apr 1, 2025
6924aaa
Update ArticleCard and ArticleEditor components: simplify language ha…
kingRayhan Apr 1, 2025
b50acb1
Enhance ArticleEditor: integrate markdown parsing for body content di…
kingRayhan Apr 1, 2025
aec8c12
Refactor ArticleEditor: implement confirmation dialog for publishing …
kingRayhan Apr 1, 2025
278a59d
Refactor PersistentRepository: remove commented-out SQL query in find…
kingRayhan Apr 1, 2025
0ea706f
Refactor ArticleEditor: streamline command execution logic and improv…
kingRayhan Apr 1, 2025
f6ec54f
Add lottie-react dependency; integrate AppAlertProvider in CommonProv…
kingRayhan Apr 1, 2025
b87c51a
Merge branch 'upgrade' of github.com:techdiary-dev/techdiary.dev-next…
kingRayhan Apr 1, 2025
eaa880d
Refactor NavbarActions: update "New diary" button to link to the arti…
kingRayhan Apr 1, 2025
0dd0bec
Refactor ArticleSidebar and UserInformationCard: pass article data to…
kingRayhan Apr 1, 2025
6ebeec2
Add env-nextjs integration: replace process.env with env for environm…
kingRayhan Apr 1, 2025
edde590
Add user ID to article author information in UserArticleFeed component
kingRayhan Apr 1, 2025
bc7cddc
Fix redirect URI in GithubOAuthService to use GITHUB_CALLBACK_URL
kingRayhan Apr 2, 2025
4d0cc56
Enhance UserArticleFeed component: include user ID in article author …
kingRayhan Apr 2, 2025
30a1ef2
Refactor API route and article actions: remove unused imports, integr…
kingRayhan Apr 2, 2025
2eb4637
Add ArticleEditor and useToggle hook; enhance ArticleMetadata with SE…
kingRayhan Apr 2, 2025
372a463
Refactor ArticleEditorDrawer: wrap confirmation message in a form for…
kingRayhan Apr 2, 2025
028f046
Integrate react-hook-form and zod for form handling in ArticleEditorD…
kingRayhan Apr 2, 2025
1cfaab9
Enhance ArticleEditorDrawer: validate canonical URL as a proper URL a…
kingRayhan Apr 2, 2025
abfee13
Refactor ArticleEditorDrawer: implement form submission handling for …
kingRayhan Apr 2, 2025
1c202b3
Update dependencies and enhance ArticleEditorDrawer with new form com…
kingRayhan Apr 2, 2025
c9e4ff2
Enhance ArticleEditorDrawer: add textarea component and update form f…
kingRayhan Apr 2, 2025
99cc77d
Update package.json to include 'badge' dependency, refactor article h…
kingRayhan Apr 3, 2025
965abbb
Refactor ArticleEditorDrawer: improve form validation and error handl…
kingRayhan Apr 3, 2025
7965575
Remove deprecated SQL dump files and clean up database schema: delete…
kingRayhan Apr 3, 2025
f177c11
Refactor TagInput component: reorder imports, update tag removal logi…
kingRayhan Apr 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions ..bfg-report/2025-04-03/21-52-31/cache-stats.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(apply,CacheStats{hitCount=876, missCount=857, loadSuccessCount=857, loadExceptionCount=0, totalLoadTime=727959918, evictionCount=0})
(tree,CacheStats{hitCount=5345, missCount=2008, loadSuccessCount=1931, loadExceptionCount=0, totalLoadTime=1583467593, evictionCount=0})
(commit,CacheStats{hitCount=501, missCount=486, loadSuccessCount=486, loadExceptionCount=0, totalLoadTime=106269389, evictionCount=0})
(tag,CacheStats{hitCount=0, missCount=0, loadSuccessCount=0, loadExceptionCount=0, totalLoadTime=0, evictionCount=0})
257 changes: 257 additions & 0 deletions ..bfg-report/2025-04-03/21-52-31/object-id-map.old-new.txt

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions .env

This file was deleted.

5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/techdiary-next.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 8 additions & 30 deletions .todo
Original file line number Diff line number Diff line change
@@ -1,30 +1,8 @@
- [] revalidate cache after update, home page and article details page
- [] upload files in laravel

- [] tag diye article filter korar somoy case insensitive vabe filter korte hobe
- [] jemnon `time & space complexity` ke `time-space-complexity` slug diye filter e aste hobe
- [] Show a email is not verified yet ribbon under navbar. Make email verified during oauth signup

## Dashboard

- [] Put a empty article graphics
- [] Cache issue
- [] Delete/Archieve articles
- [] Make dashboard navlinks bold on active

## Editor

- [] Article tags
- [] Fixed save button of drawer
- [] Article cover upload
- [] Make mobile friendly

## Backend Specific

- [x] 🔥 meta uuid not autometically creating
- [] Article feed sort by published_at and also discuss about this with shoaib vai
- [] PATCH /api/profile: db error on empty string
- [] Study about token previleages
- [] Check cascade behabour of tags
- [] Check for fortify with latest version
- [] make unsplash proxy api with auth middleware
- [] article feed
- [] article details
- [] tags
- [] tags archive

- [] dashboard (matrix, article-list)
- [] bookmarks
- [] settings()
39 changes: 39 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Next.js: Node",
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
"args": ["dev"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
},
{
"type": "chrome",
"request": "launch",
"name": "Next.js: Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack://_N_E/*": "${webRoot}/*"
}
},
{
"type": "node",
"request": "launch",
"name": "Next.js: Build",
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
"args": ["build"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
}
],
"compounds": [
{
"name": "Next.js: Full",
"configurations": ["Next.js: Node", "Next.js: Chrome"]
}
]
}
Binary file added bun.lockb
Binary file not shown.
21 changes: 21 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/styles/app.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
17 changes: 17 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import "dotenv/config";
import { defineConfig } from "drizzle-kit";
import * as process from "node:process";
import dotenv from "dotenv";

dotenv.config({
path: ".env.local",
});

export default defineConfig({
out: "./migrations",
schema: "./src/backend/schemas/schemas.ts",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
});
28 changes: 28 additions & 0 deletions migrations/0000_real_nomad.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
CREATE TABLE "user_socials" (
"id" serial PRIMARY KEY NOT NULL,
"service" varchar NOT NULL,
"service_uid" varchar NOT NULL,
"user_id" uuid NOT NULL,
"created_at" timestamp,
"updated_at" timestamp
);
--> statement-breakpoint
CREATE TABLE "users" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"name" varchar NOT NULL,
"username" varchar NOT NULL,
"email" varchar,
"profilePhoto" varchar,
"education" varchar,
"designation" varchar,
"bio" varchar,
"website_url" varchar,
"location" varchar,
"social_links" json,
"profile_readme" text,
"skills" varchar,
"created_at" timestamp,
"updated_at" timestamp
);
--> statement-breakpoint
ALTER TABLE "user_socials" ADD CONSTRAINT "user_socials_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
8 changes: 8 additions & 0 deletions migrations/0001_useful_husk.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE "user_sessions" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" uuid NOT NULL,
"created_at" timestamp,
"updated_at" timestamp
);
--> statement-breakpoint
ALTER TABLE "user_sessions" ADD CONSTRAINT "user_sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
1 change: 1 addition & 0 deletions migrations/0002_wakeful_dorian_gray.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "user_sessions" ADD COLUMN "token" varchar NOT NULL;
1 change: 1 addition & 0 deletions migrations/0003_certain_corsair.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "users" RENAME COLUMN "profilePhoto" TO "profile_photo";
1 change: 1 addition & 0 deletions migrations/0004_normal_skrulls.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "user_sessions" ADD COLUMN "device" varchar NOT NULL;
1 change: 1 addition & 0 deletions migrations/0005_noisy_stark_industries.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "user_sessions" ALTER COLUMN "device" DROP NOT NULL;
25 changes: 25 additions & 0 deletions migrations/0006_greedy_greymalkin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CREATE TABLE "articles" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"title" varchar NOT NULL,
"slug" varchar NOT NULL,
"excerpt" varchar,
"content" text,
"is_published" boolean DEFAULT false,
"approved_at" timestamp,
"metadata" json,
"author_id" uuid NOT NULL,
"created_at" timestamp,
"updated_at" timestamp
);
--> statement-breakpoint
CREATE TABLE "user_follows" (
"id" serial PRIMARY KEY NOT NULL,
"follower_id" uuid NOT NULL,
"followee_id" uuid NOT NULL,
"created_at" timestamp,
"updated_at" timestamp
);
--> statement-breakpoint
ALTER TABLE "articles" ADD CONSTRAINT "articles_author_id_users_id_fk" FOREIGN KEY ("author_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "user_follows" ADD CONSTRAINT "user_follows_follower_id_users_id_fk" FOREIGN KEY ("follower_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "user_follows" ADD CONSTRAINT "user_follows_followee_id_users_id_fk" FOREIGN KEY ("followee_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
1 change: 1 addition & 0 deletions migrations/0007_clear_polaris.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "articles" ADD COLUMN "cover_image" json;
1 change: 1 addition & 0 deletions migrations/0008_lonely_luminals.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "articles" ALTER COLUMN "cover_image" SET DATA TYPE varchar;
1 change: 1 addition & 0 deletions migrations/0009_chemical_shooting_star.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "articles" RENAME COLUMN "slug" TO "handle";
1 change: 1 addition & 0 deletions migrations/0010_late_strong_guy.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "articles" RENAME COLUMN "content" TO "body";
1 change: 1 addition & 0 deletions migrations/0011_majestic_chat.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "articles" ALTER COLUMN "cover_image" SET DATA TYPE json;
2 changes: 2 additions & 0 deletions migrations/0012_mute_bulldozer.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "articles" ALTER COLUMN "cover_image" SET DATA TYPE jsonb;--> statement-breakpoint
ALTER TABLE "articles" ALTER COLUMN "metadata" SET DATA TYPE jsonb;
1 change: 1 addition & 0 deletions migrations/0013_early_mariko_yashida.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "articles" ADD COLUMN "published_at" timestamp;
13 changes: 13 additions & 0 deletions migrations/0014_first_exiles.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE "comments" (
"id" serial PRIMARY KEY NOT NULL,
"content" text NOT NULL,
"article_id" uuid NOT NULL,
"user_id" uuid NOT NULL,
"parent_id" uuid,
"created_at" timestamp DEFAULT now(),
"updated_at" timestamp DEFAULT now()
);
--> statement-breakpoint
ALTER TABLE "comments" ADD CONSTRAINT "comments_article_id_articles_id_fk" FOREIGN KEY ("article_id") REFERENCES "public"."articles"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "comments" ADD CONSTRAINT "comments_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "comments" ADD CONSTRAINT "comments_parent_id_comments_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."comments"("id") ON DELETE cascade ON UPDATE no action;
1 change: 1 addition & 0 deletions migrations/0015_crazy_leper_queen.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "comments" ALTER COLUMN "id" SET DATA TYPE uuid;
1 change: 1 addition & 0 deletions migrations/0016_narrow_wendell_rand.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "comments" ALTER COLUMN "id" SET DEFAULT gen_random_uuid();
1 change: 1 addition & 0 deletions migrations/0017_productive_ender_wiggin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "comments" RENAME COLUMN "content" TO "body";
3 changes: 3 additions & 0 deletions migrations/0018_striped_greymalkin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "comments" DROP CONSTRAINT "comments_parent_id_comments_id_fk";
--> statement-breakpoint
ALTER TABLE "comments" DROP COLUMN "parent_id";
2 changes: 2 additions & 0 deletions migrations/0019_solid_violations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "comments" ADD COLUMN "parent_id" uuid;--> statement-breakpoint
ALTER TABLE "comments" ADD CONSTRAINT "comments_parent_id_comments_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."comments"("id") ON DELETE cascade ON UPDATE no action;
5 changes: 5 additions & 0 deletions migrations/0020_easy_boomer.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE "comments" DROP CONSTRAINT "comments_article_id_articles_id_fk";
--> statement-breakpoint
ALTER TABLE "comments" ADD COLUMN "commentable_type" varchar NOT NULL;--> statement-breakpoint
ALTER TABLE "comments" ADD COLUMN "commentable_id" uuid NOT NULL;--> statement-breakpoint
ALTER TABLE "comments" DROP COLUMN "article_id";
18 changes: 18 additions & 0 deletions migrations/0021_great_hemingway.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE "article_tag" (
"id" serial PRIMARY KEY NOT NULL,
"article_id" uuid NOT NULL,
"tag_id" uuid NOT NULL,
"created_at" timestamp DEFAULT now()
);
--> statement-breakpoint
CREATE TABLE "tags" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"name" varchar(50) NOT NULL,
"icon" jsonb,
"color" varchar(6),
"description" text,
"created_at" timestamp DEFAULT now()
);
--> statement-breakpoint
ALTER TABLE "article_tag" ADD CONSTRAINT "article_tag_article_id_articles_id_fk" FOREIGN KEY ("article_id") REFERENCES "public"."articles"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "article_tag" ADD CONSTRAINT "article_tag_tag_id_tags_id_fk" FOREIGN KEY ("tag_id") REFERENCES "public"."tags"("id") ON DELETE cascade ON UPDATE no action;
4 changes: 4 additions & 0 deletions migrations/0022_sad_ares.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE "article_tag" ALTER COLUMN "created_at" DROP DEFAULT;--> statement-breakpoint
ALTER TABLE "tags" ALTER COLUMN "created_at" DROP DEFAULT;--> statement-breakpoint
ALTER TABLE "article_tag" ADD COLUMN "updated_at" timestamp;--> statement-breakpoint
ALTER TABLE "tags" ADD COLUMN "updated_at" timestamp;
3 changes: 3 additions & 0 deletions migrations/0023_tranquil_dagger.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "user_sessions" ADD COLUMN "device_type" varchar;--> statement-breakpoint
ALTER TABLE "user_sessions" ADD COLUMN "ip" varchar;--> statement-breakpoint
ALTER TABLE "user_sessions" ADD COLUMN "last_action_at" timestamp;
1 change: 1 addition & 0 deletions migrations/0024_complex_prodigy.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "user_sessions" DROP COLUMN "device_type";
Loading