PHPackages                             emteknetnz/silverstripe-varchar-polyfill - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. emteknetnz/silverstripe-varchar-polyfill

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

emteknetnz/silverstripe-varchar-polyfill
========================================

Polyfill for pre CMS 5.4 for DBClassNameVarchar

1.0.2(1y ago)014MITPHPPHP ^7.4 || ^8.1

Since Sep 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/emteknetnz/silverstripe-varchar-polyfill)[ Packagist](https://packagist.org/packages/emteknetnz/silverstripe-varchar-polyfill)[ RSS](/packages/emteknetnz-silverstripe-varchar-polyfill/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

silverstripe-varchar-polyfill
=============================

[](#silverstripe-varchar-polyfill)

This module provides a polyfill for `DBClassNameVarchar` which is not available before `silverstripe/framework` 5.4.0 and was added in this [pull-request](https://github.com/silverstripe/silverstripe-framework/pull/11359).

This module works on Silverstripe 4 and 5.

This functionality this provides is described [here](https://github.com/silverstripe/developer-docs/blob/5/en/02_Developer_Guides/08_Performance/06_ORM.md#changing-classname-column-from-enum-to-varchar-classname-varchar).

When upgrading to CMS 6, and also optionally 5.4, you should uninstall this module and instead use the `DBClassNameVarchar` class provided in `silverstripe/framework`.

Installation
------------

[](#installation)

```
composer require emteknetnz/silverstripe-varchar-polyfill
```

Before installing this module, it it's recommended that you first validate that `ALTER TABLE` queries are a significant bottleneck when running `dev/build`. You can use [emteknetnz/silverstripe-dev-build-benchark](https://github.com/emteknetnz/silverstripe-dev-build-benchmark) to help with this.

Configuration
-------------

[](#configuration)

Add the following configuration to your project to enable the polyfill:

```
SilverStripe\ORM\DataObject:
  fixed_fields:
    ClassName: DBClassNameVarcharPolyfill

SilverStripe\ORM\FieldType\DBPolymorphicForeignKey:
  composite_db:
    Class: "DBClassNameVarcharPolyfill('SilverStripe\\ORM\\DataObject', ['index' => false])"
```

Warning

After updating this config all necessary `ALTER TABLE` queries to change `ClassName` columns from `enum` to `varchar` will be run on the next `dev/build`, which can take a long time on large databases. Keep this in mind in particular when deploying to production.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

614d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a25bc04c5720a36869d5a39c6449dde7eb43e19b7c8e666d5f632d6a9ab440b1?d=identicon)[emteknetnz](/maintainers/emteknetnz)

---

Top Contributors

[![emteknetnz](https://avatars.githubusercontent.com/u/4809037?v=4)](https://github.com/emteknetnz "emteknetnz (10 commits)")

### Embed Badge

![Health badge](/badges/emteknetnz-silverstripe-varchar-polyfill/health.svg)

```
[![Health](https://phpackages.com/badges/emteknetnz-silverstripe-varchar-polyfill/health.svg)](https://phpackages.com/packages/emteknetnz-silverstripe-varchar-polyfill)
```

###  Alternatives

[silverstripe/multi-domain

Allows multiple domains to access one CMS instance, mapping them to different sections of the hierarchy

141.6k](/packages/silverstripe-multi-domain)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
