You cannot auto-increment a varchar
type column in mysql.
You can instead do one of the following:
- Lookup existing records and get a
COUNT
then concatenate your varchar village
to have both castle
and the value
. Perhaps using:
SELECT count(*) FROM settlement WHERE village LIKE 'Castle%';
- Use two tables to define your
settlement types
and have an ID there instead, which will allow you to read your settlements
back out with a join to then concatenate your real
name.
If you do not do something similar to this on read/write then you'll keep running into having to update your column.