Monday, January 20, 2025

Refreshing/Clean a Database with SQL and Entity Framework

Quick steps to refresh your database: 1. Drop All Tables
Run the following SQL script to drop all existing tables:

Code Snippet

Note: when you try above than you got some errors but don't its because of relationship execute multiple times. 2. Recreate EF Migration Table Recreate the EF migration table with this script:

Code Snippet

3. Update the Database Run the following command to reapply migrations and update the schema: update-database These steps ensure a clean database reset while maintaining EF migration compatibility.

No comments:

Post a Comment

AI Orchestration with Ruflo: From Prompt Engineering to Multi-Agent Systems

Quick learning path: Prompt Engineering → Context Engineering → Agent Engineering → System Engineering → Ruflo multi-agent orchestration. Ar...