npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@contensu/directus-extension-safe-rename

v1.0.1

Published

Rename collections and fields across all Directus metadata, relations, permissions, and flows.

Readme

directus-extension-safe-rename

A Directus extension that lets you safely rename collections and fields — updating all metadata, relations, permissions, presets, flows, and more in a single atomic transaction.

Built by Contensu — a Directus agency.


Why?

Directus does not provide a built-in way to rename collections or fields after they are created. Doing it manually means hunting down every reference across a dozen system tables — and missing one breaks your project silently.

This extension handles all of that automatically.


Features

  • 🏷️ Rename collections — renames the table and updates all Directus system tables
  • 🔤 Rename fields — renames the column and updates all references across metadata, relations, permissions, presets, flows, panels, and more
  • 🔗 Relation-aware — updates field references in related collections too (O2M, M2M, M2A)
  • 🔒 Atomic transactions — all changes happen in a single DB transaction, rolls back on failure
  • 🧹 Cache clearing — automatically clears Directus schema cache after renaming
  • 🛡️ Protected collections — prevents renaming of Directus system collections (directus_*)

What gets updated

When renaming a collection

| Table | Columns updated | | ------------------------ | ----------------------------------- | | directus_collections | collection, group | | directus_fields | collection | | directus_relations | many_collection, one_collection | | directus_permissions | collection | | directus_presets | collection | | directus_shares | collection | | directus_versions | collection | | directus_revisions | collection, item | | directus_activity | collection | | directus_notifications | collection | | directus_comments | collection | | directus_flows | options.collections[] | | directus_operations | options.collection |

When renaming a field

| Table | Columns updated | | ---------------------- | --------------------------------------------------------------------------------- | | directus_fields | field, group, options, display_options, conditions, validation | | directus_relations | many_field, one_field, one_collection_field, junction_field, sort_field | | directus_collections | archive_field, sort_field, display_template, item_duplication_fields | | directus_permissions | fields (CSV), permissions, validation, presets (JSON) | | directus_presets | layout_query, layout_options, filter | | directus_flows | options | | directus_operations | options | | directus_panels | options |


Requirements

  • Directus ^11.0.0
  • Admin access required

Installation

Via npm (recommended)

npm install @contensu/directus-extension-safe-rename

Then restart your Directus instance.

Via Directus Marketplace

This extension requires direct database access and is classified as a non-sandboxed extension. It will not appear in the Directus Marketplace by default.

To enable Marketplace installation, set the following environment variable in your Directus instance:

MARKETPLACE_TRUST="all"

⚠️ This setting allows installation of all non-sandboxed extensions from the Marketplace. Only enable it if you trust the extensions you are installing.

For more details, see the Directus self-hosting extensions guide.


Usage

  1. Go to Settings → Project Settings and enable the Schema Rename module under the Modules bar
  2. The Schema Rename module will now appear in the left sidebar — click it
  3. Select a collection from the list
  4. To rename the collection — edit the collection name field and click Rename Collection
  5. To rename fields — edit any field name in the list and click Rename Fields

Rename Collection

Rename Fields


Database Support

| Database | Status | | ------------- | --------- | | PostgreSQL 13 | ✅ Tested | | PostgreSQL 16 | ✅ Tested | | MySQL 8 | ✅ Tested | | MariaDB 11 | ✅ Tested | | SQLite | ✅ Tested |

Tested against Directus 11.14.1, 11.16.1, and 11.17.0.


CI & Releases

Every pull request runs a full integration test suite across 15 jobs (3 Directus versions × 5 databases) via GitHub Actions. Releases are published to npm automatically when a version tag is pushed.


Roadmap

  • [ ] Impact analyzer — preview all changes before applying
  • [ ] Translations support

Contributing

Pull requests are welcome. Please open an issue first to discuss what you would like to change.


License

MIT © Contensu