manubier
manubier
Explore posts from servers
CDCloudflare Developers
Created by manubier on 10/11/2024 in #general-help
Seeking Best Practices for Using Drizzle ORM with D1, Especially for Migrations
Hi everyone, I’m currently working on a project using Drizzle ORM with D1, and I’ve encountered some challenges around handling migrations. I’d really appreciate any insights or best practices from those who have navigated this before. Here are some of the specific questions and areas where I’m looking for guidance: 1. Creating Migrations: - What are the best practices for generating migration files? - Should I be using the Drizzle commands like DrizzleKit generate for this, or should I stick to using Wrangler commands? 2. Applying Migrations Locally and in Production: - When applying migrations, is it better to use the Wrangler command or the DrizzleKit migrate command? - I’ve been using DrizzleKit generate to create migration files, then applying them with Wrangler, which has worked both locally and in production. However, I recently encountered a situation where a migration applied successfully locally but failed when I tried to apply it in production. - Additionally, Wrangler doesn’t seem to have a command for dropping migrations. I used Drizzle drop, but since the initial application was through Wrangler, it didn’t properly adjust my database. This left my local database in an odd state, which I resolved by recreating it, but I’m hoping to avoid this in the future. What’s the recommended approach for dropping or reverting migrations properly? 3. Integrating Migrations into CI/CD Pipeline: - How can I integrate the migration process into my CI/CD pipeline using GitHub Actions? - I attempted to automate applying migrations in production through GitHub Actions but ran into some difficulties. Has anyone successfully set this up, and if so, could you share your approach? Overall, I think there’s a need for a comprehensive guide on best practices for using Drizzle ORM with D1, particularly around handling migrations. If anyone has advice or experience to share, I’d be incredibly grateful! Thanks in advance!
5 replies
RRailway
Created by manubier on 1/31/2024 in #✋|help
Postgres Database Migration Stuck?
No description
8 replies
RRailway
Created by manubier on 1/18/2024 in #✋|help
Static IPs
We are using an API that just notified us that they will be forcing us to make our calls from a whitelisted IP starting on Feb 21. Is there a way to keep our services on Railway and comply with this?
10 replies
RRailway
Created by manubier on 1/17/2024 in #✋|help
Application failing after migration to database v2
Hey there, I had to migrate Postgres and REDIS. REDIS worked just fine but after migrating Postgres my application keeps crashing.
6 replies
RRailway
Created by manubier on 11/23/2023 in #✋|help
NPM build script started to fail
I am running migrations during the build and have the following script in my package.json for this: "migrate:deploy": "DATABASE_URL="$MIGRATE_DATABASE_URL" prisma migrate deploy", It seems like the script doesn't have access to the ENV variables anymore even though there were no changes.
43 replies