Ecto Schema: Enum Data Type?

Were you using postgres?

idiot@/tmp:enum_test> create type hello_type as enum ('a', 'b', 'c');
CREATE TYPE
Time: 0.021s
idiot@/tmp:enum_test> create table test (name varchar, type hello_type);
CREATE TABLE
Time: 0.018s
idiot@/tmp:enum_test> insert into test values ('hello', 'a');
INSERT 0 1
Time: 0.007s
idiot@/tmp:enum_test> insert into test values ('hello', 'b');
INSERT 0 1
Time: 0.001s
idiot@/tmp:enum_test> insert into test values ('hello', 'c');
INSERT 0 1
Time: 0.001s
idiot@/tmp:enum_test> select * from test;
+--------+--------+
| name   | type   |
|--------+--------|
| hello  | a      |
| hello  | b      |
| hello  | c      |
+--------+--------+
SELECT 3
Time: 0.008s
idiot@/tmp:enum_test> alter type hello_type add value 'd' after 'a';
ALTER TYPE
Time: 0.004s
idiot@/tmp:enum_test> insert into test values ('hello', 'd');
INSERT 0 1
Time: 0.001s
idiot@/tmp:enum_test> select * from test;
+--------+--------+
| name   | type   |
|--------+--------|
| hello  | a      |
| hello  | b      |
| hello  | c      |
| hello  | d      |
+--------+--------+
SELECT 4
Time: 0.008s

Inserting new enum values works fine there. Deleting them is a bit more involved, but not by much, and it definitely wouldn’t destroy your data if done properly. Instead, using enum types would help keeping it consistent.