remove-model

Guide safe deletion of NetBox models across code, docs, UI, and API layers.

21.3k|3.1k|Updated Feb 29, 2016
One-click install
npx skills add https://github.com/netbox-community/netbox --skill remove-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: remove-model
Source: https://github.com/netbox-community/netbox/tree/main/.claude/skills/remove-model
Command: npx skills add https://github.com/netbox-community/netbox --skill remove-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Removing a NetBox model cleanly is risky because many parts of the system (UI, APIs, GraphQL, tests, docs, navigation, and database migrations) may reference it, causing import or runtime failures.

Core Features & Use Cases

  • End-to-end removal checklist: Guides you through deleting all consumers (tests, docs, nav, search, GraphQL, REST, URLs, views, tables, forms, filtersets, choices) before removing the model itself.
  • Safety guardrails: Warns you to identify dependent models and non-nullable foreign keys first, so migrations and startup don’t break.
  • Migration-first workflow: Directs you to generate the correct Django migration via makemigrations (including any RemoveField operations) and review it before applying.

Quick Start

Use the remove-model guide when you need to deprecate or delete an existing NetBox model after confirming nothing retained has non-nullable foreign keys pointing to it.

Frequently Asked Questions about remove-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely remove a Django model from NetBox without breaking imports?

To safely remove a NetBox model, delete all consumers first—tests, docs, navigation, GraphQL, REST, URLs, views, tables, forms, and filtersets—before removing the model itself to prevent import or runtime failures.

What is the correct Django migration workflow for deleting a NetBox model?

The correct workflow for model removal migration is generating Django migrations via makemigrations, including any RemoveField operations for foreign keys, and reviewing the migration file before applying it to the database.

Can I delete a NetBox model if other models have non-nullable foreign keys pointing to it?

You should not delete a NetBox model if retained models have non-nullable foreign keys pointing to it without addressing those dependencies first, as this will cause migration failures and broken references.

What's the best way to clean up GraphQL and API references when removing a NetBox model?

The best way to clean up API and GraphQL references during model removal is to systematically delete all consumers including GraphQL types, REST endpoints, URLs, views, and choices before removing the model class itself.

Why does NetBox crash on startup after I delete a model from the codebase?

NetBox crashes on startup after model deletion because broken references remain in UI, APIs, GraphQL, tests, navigation, or database migrations that still import the removed model, requiring consumer-first removal.