---
title: "Migrating Schemas Across Many Neon Projects Using DrizzleORM"
description: "Database-per-tenant setups need every tenant database kept on the same schema, and this walkthrough automates that across many Neon projects with DrizzleORM, the Neon API and GitHub Actions."
url: "https://swe.quest/articles/migrating-schemas-across-many-neon-projects-using-drizzleorm-bb1d354116390120"
canonical: "https://neon.com/blog/migrating-schemas"
source: "Neon"
published: "2024-11-21"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["schema-migrations","multi-tenancy","postgres","ci-cd","javascript"]
---

# Migrating Schemas Across Many Neon Projects Using DrizzleORM

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-11-21, 10 min read, How-to. Original: [https://neon.com/blog/migrating-schemas](https://neon.com/blog/migrating-schemas)

## Summary

Database-per-tenant setups need every tenant database kept on the same schema, and this walkthrough automates that across many Neon projects with DrizzleORM, the Neon API and GitHub Actions. A create script provisions a Neon project per customer. A generate script lists all projects, writes a per-tenant drizzle.config.ts, runs drizzle-kit generate, stores each connection string as an encrypted GitHub secret, and rewrites the workflow YAML to expose those secrets. A migrate script, triggered when a PR is merged to main, runs drizzle-kit migrate against every config so schema changes reach all tenants.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)

## Prerequisites

- Postgres basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- Node.js scripting ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- GitHub Actions ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))

## Keywords

Neon, DrizzleORM, Drizzle Kit, GitHub Actions, Neon API, Octokit

## Related posts

- [Database-per-User Architecture With Shared Application Environments: How and Why](https://swe.quest/articles/database-per-user-architecture-with-shared-application-environments-how-and-why-75dc31cab7b5ea77.md): Neon · 2024-10-18 · Medium · 8 min read · Multi-tenancy, PostgreSQL, System design, Schema migrations
  A single shared application environment serving many per-customer Neon Postgres databases keeps deployment simple, but every tenant database must stay at the same schema version and data residency is hard to offer.
- [Build a Database App with Drizzle ORM and Deno](https://swe.quest/articles/build-a-database-app-with-drizzle-orm-and-deno-692f9df52f193839.md): Deno · 2024-11-13 · Medium · 7 min read · TypeScript, PostgreSQL, JavaScript, Schema migrations
  Drizzle ORM can be used from Deno via npm compatibility to get type-safe CRUD access to PostgreSQL.
- [Control Planes for Database-Per-User in Neon](https://swe.quest/articles/control-planes-for-database-per-user-in-neon-f18c18dcc1448d8f.md): Neon · 2024-09-11 · Medium · 12 min read · Multi-tenancy, PostgreSQL, Schema migrations, System design
  A database-per-user architecture on Neon usually means one Neon project per customer, and that quickly needs a control plane to manage onboarding, monitoring and schema upgrades across many projects.
- [Inside a Kylon room, where people and agents build apps on Neon](https://swe.quest/articles/inside-a-kylon-room-where-people-and-agents-build-apps-on-neon-7c02cd9384e86f37.md): Neon · 2026-11-04 · Easy · 5 min read · PostgreSQL, AI agents, Multi-tenancy, Serverless, Schema migrations
  Kylon, a shared workspace where teams and AI agents build internal apps like CRMs and invoice trackers, maps its product directly onto Neon resources: one Neon project per workspace, one database per app, and one branch per draft.
- [A database for every preview environment using Neon, GitHub Actions, and Vercel](https://swe.quest/articles/a-database-for-every-preview-environment-using-neon-github-actions-and-vercel-dd5fe24cba2d12b5.md): Neon · 2023-04-14 · Medium · 14 min read · PostgreSQL, CI/CD, Deployment, Schema migrations
  Neon's copy-on-write branching can give every pull request its own production-like Postgres database, avoiding the bottlenecks of shared staging or shared preview databases.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
