Skip to content

Add Drizzle/Neon Postgres schema for collections, urls, and collectio… - #15

Merged
ebulgakov merged 1 commit into
mainfrom
feature/db-init
Jul 30, 2026
Merged

Add Drizzle/Neon Postgres schema for collections, urls, and collectio…#15
ebulgakov merged 1 commit into
mainfrom
feature/db-init

Conversation

@ebulgakov

@ebulgakov ebulgakov commented Jul 30, 2026

Copy link
Copy Markdown
Owner

…n_items

Introduces the core data layer: per-user collections of URLs joined many-to-many via collection_items, with a case-insensitive unique collection name per user, a persistent shareable slug, and per-user URL dedup on a stored normalized_url column. collections.user_id and urls.user_id FK across schemas into Neon Auth's neon_auth.user(id), which is declared reference-only (not exported from schema.ts) so Drizzle Kit never tries to manage that table.

Summary by CodeRabbit

  • New Features
    • Added database-backed storage for collections, URLs, and collection items.
    • Added support for creating and applying PostgreSQL database migrations.
    • Added data integrity rules, including ownership, uniqueness, cascading deletion, and optimized lookups.
    • Added database connection initialization and environment configuration validation.

…n_items

Introduces the core data layer: per-user collections of URLs joined
many-to-many via collection_items, with a case-insensitive unique
collection name per user, a persistent shareable slug, and per-user
URL dedup on a stored normalized_url column. collections.user_id and
urls.user_id FK across schemas into Neon Auth's neon_auth.user(id),
which is declared reference-only (not exported from schema.ts) so
Drizzle Kit never tries to manage that table.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
linkfolio Ready Ready Preview Jul 30, 2026 1:06pm

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b1be997-ba4a-4481-85e4-c17b58a74fc4

📥 Commits

Reviewing files that changed from the base of the PR and between 59cd16b and e38e0ce.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .prettierignore
  • drizzle.config.ts
  • package.json
  • server/db/index.ts
  • server/db/migrations/0000_flawless_electro.sql
  • server/db/migrations/meta/0000_snapshot.json
  • server/db/migrations/meta/_journal.json
  • server/db/neon-auth.ts
  • server/db/schema.ts

📝 Walkthrough

Walkthrough

Adds a Drizzle PostgreSQL schema for collections, URLs, and collection items, connects it to Neon Auth, initializes a Neon-backed database client, configures migration tooling, and adds the initial SQL migration and metadata.

Changes

Database foundation

Layer / File(s) Summary
Schema contracts
server/db/neon-auth.ts, server/db/schema.ts
Defines Neon Auth user references and the collections, urls, and collectionItems tables with ownership, uniqueness, foreign keys, timestamps, and query indexes.
Drizzle runtime and tooling
drizzle.config.ts, server/db/index.ts, package.json
Configures PostgreSQL migrations, adds database scripts and packages, and exports a Neon-backed Drizzle client.
Initial migration artifacts
server/db/migrations/*, .prettierignore
Adds the initial SQL migration, schema snapshot, migration journal, and migration formatting ignore rule.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/db-init

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant