# Jihadkhawaja Egroo Egroo

> EF Core Migrations — Egroo Schema Workflow

- Skill: `tomevault-io/jihadkhawaja-egroo-egroo` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/jihadkhawaja-egroo-egroo`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/jihadkhawaja-egroo-egroo/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/jihadkhawaja-egroo-egroo

---


# EF Core Migrations — Egroo Schema Workflow

## When to Use

- Adding, removing, or renaming entity properties that are persisted to the database
- Changing `User`, `Channel`, `Message`, agent, or other EF Core entity mappings
- Modifying `DataContext`, `OnModelCreating`, owned entities, indexes, constraints, or relationships
- Updating table or column naming behavior
- Any change where the runtime model and the database schema would otherwise drift

---

## Required Rule

If a change affects the EF Core schema, you must:

1. Add a migration for the change.
2. Update the database with that migration.
3. Verify the solution still builds and the relevant tests still pass.

Do not leave entity/model changes without a matching migration.

---

## Commands

Run from the repository root:

```powershell
.\scripts\add-migration.ps1 "<MigrationName>"
.\scripts\update-database.ps1
```

Migrations target `src/Egroo.Server`.

---

## What Counts As A Schema Change

- New persisted properties on shared/server entities
- Removed persisted properties
- Property type changes
- New `DbSet<>` entries
- Relationship changes (`HasOne`, `HasMany`, FKs, join tables)
- Index changes
- Owned type changes
- Table/column naming changes
- Required/optional changes that affect generated columns or constraints

These do not usually require a migration by themselves:

- `[NotMapped]` properties only
- Pure UI/view-model changes
- Comments, logging, or behavior-only service changes

---

## Verification Checklist

- `dotnet build src/Egroo.slnx --configuration Debug`
- `dotnet test src/Egroo.Server.Test/Egroo.Server.Test.csproj --verbosity normal` when server behavior changed
- Confirm the migration files are present under `src/Egroo.Server/Migrations/`
- Confirm `DataContextModelSnapshot` reflects the new schema

---

## Egroo-Specific Notes

- The repo uses lowercase naming conventions. Expect generated database names to end up lowercase.
- Prefer the provided PowerShell scripts instead of ad hoc EF commands so the right project/startup wiring is used.
- If a change touches shared models but should not persist, keep it `[NotMapped]` or otherwise excluded from the EF model.

---
> Source: [jihadkhawaja/Egroo](https://github.com/jihadkhawaja/Egroo) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-24 -->

