Replies: 1 comment
|
1. Declarative + Drizzle: 2. This is exactly the case declarative solves. The core mechanical difference: One caveat worth planning for: declarative apply can still refuse or misbehave on changes that aren't losslessly invertible from live state alone (renames that look like drop+create, data-affecting column type narrowing). Atlas's |
Uh oh!
There was an error while loading. Please reload this page.
Atlas Declarative Approach with Drizzle ORM + Multi-Developer Testing Environment
Background
We're currently using Drizzle ORM to define our database schema and want to integrate Atlas for schema migrations. We're trying to understand the best approach for our workflow and how to handle some specific challenges.
Current Setup
Questions
1. Atlas Declarative Approach with Drizzle
We have our schema defined in Drizzle ORM and want to use Atlas's declarative approach. Our current
atlas.hcllooks like this:Questions:
atlas schema apply(declarative) oratlas migrate apply(versioned) with Drizzle?migrations/folder when using the declarative approach?2. Multi-Developer Testing Environment Challenge
We have a shared staging database where multiple developers deploy different versions for testing. This creates conflicts:
rolesCurrent Error Example:
Questions:
3. Current Workflow Issues
Our GitHub Actions workflow:
atlas migrate applywith--allow-dirtyWe're considering switching to:
atlas schema diff --env stagingatlas schema apply --env staging --auto-approveIs this the right approach for a Drizzle + Atlas setup?
Desired Workflow
Ideally, we want:
Environment Details
Any guidance on best practices for this setup would be greatly appreciated! Particularly interested in how other teams handle multi-developer environments with Atlas.
Additional Context:
We're open to changing our approach if there's a better way to handle schema management with Drizzle + Atlas for our multi-environment setup.
All reactions