<p>Something like this should work:</p>

<pre><code>$this-&gt;alterColumn('tableName', 'columnName', "enum('existingOption1','existingOption2','newOption') NULL");
</code></pre>

CC BY-SA 3.0
2017-06-01T21:00:12.027Z
2017-06-01T21:00:12.027Z
Brad Bell
<p>I need to add a value to my plugin database for an ENUM field but I am struggling to find the correct syntax for the alterColumn method.</p>

<p>I want to do this but with alterColumn if possible?</p>

<pre><code>ALTER TABLE tableName CHANGE columnName columnName ENUM('existingOption1', 'existingOption2', 'newOption') DEFAULT NULL;
</code></pre>

<p>Cheers</p>

<plugin-development><migration><createcommand>
How to use alterColumn to change the values of an ENUM field in a DB Migration
# How to use alterColumn to change the values of an ENUM field in a DB Migration

(Asked by: username_0 on 2017-06-01)

I need to add a value to my plugin database for an ENUM field but I am struggling to find the correct syntax for the alterColumn method.
I want to do this but with alterColumn if possible?
ALTER TABLE tableName CHANGE columnName columnName ENUM('existingOption1', 'existingOption2', 'newOption') DEFAULT NULL;

Cheers

**Tags:** plugin-development, migration, createcommand


---

## 1 answers

### Answer by username_1 on 2017-06-01. Score: 0 | Accepted answer

Something like this should work:
$this->alterColumn('tableName', 'columnName', "enum('existingOption1','existingOption2','newOption') NULL");


---

