# `database/seeds/`

Idempotent SQL Server seeds. Apply after migrations.

| File                       | Seeds                                                                                                                |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `01_roles_permissions.sql` | Canonical permissions + system roles (`system-admin`, `admin`, `manager`, `user`, `guest`) + grants for system-admin |
| `02_default_tenant.sql`    | Default `loma-portal` tenant                                                                                         |

Admin user creation lives in `prisma/seed.ts` because it needs Argon2id-compatible hashing (Postgres side is canonical). To seed an admin on SQL Server only, port the hashing into a CLR procedure or seed via the .NET API after deployment.

## Running

```bash
sqlcmd -S "localhost,1433" -U sa -P "$SQLSERVER_PASSWORD" -d "$SQLSERVER_DB" \
  -i database/seeds/01_roles_permissions.sql \
  -i database/seeds/02_default_tenant.sql
```
