# Modifying OpenMRS database table column character count

**URL:** <https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384>\
**Category:** Development\
**Tags:** data-model\
**Created:** [December 4, 2017, 2:56am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384 "2017-12-04T02:56:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zachraduban](https://talk.openmrs.org/letter_avatar/zachraduban/32/6_449c533f586939b6e5f246632a46421f.png) [@zachraduban](https://talk.openmrs.org/u/zachraduban)\
**Post date:** [December 4, 2017, 2:56am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/1 "2017-12-04T02:56:08Z")

</div>

May I change the character limit for a certain column in the OpenMRS database tables? Is it allowed? Will it work? Are there any bad effects?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 4, 2017, 7:05am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/2 "2017-12-04T07:05:24Z")

</div>

Which table? Which column? And why?

---

<div class="post-metadata">

**Author:** ![zachraduban](https://talk.openmrs.org/letter_avatar/zachraduban/32/6_449c533f586939b6e5f246632a46421f.png) [@zachraduban](https://talk.openmrs.org/u/zachraduban)\
**Post date:** [December 4, 2017, 7:30am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/3 "2017-12-04T07:30:21Z")

</div>

The family\_name, given\_name, middle\_name, columns of the person\_name table.

Because some names might not fit the 50 character limit.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 4, 2017, 7:44am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/4 "2017-12-04T07:44:46Z")

</div>

Do you already have such names?

---

<div class="post-metadata">

**Author:** ![zachraduban](https://talk.openmrs.org/letter_avatar/zachraduban/32/6_449c533f586939b6e5f246632a46421f.png) [@zachraduban](https://talk.openmrs.org/u/zachraduban)\
**Post date:** [December 4, 2017, 8:17am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/5 "2017-12-04T08:17:05Z")

</div>

Yes. For example: Ratziel Timshel Ismail Zerubbabel Zabud Zimry Pike Blavatsky Philo Judaeus Polidorus Isurenus Morya Nylghara Rakoczy Kuthumi Krishnamurti Ashram Jerram Akasha Aum Ultimus Rufinorum Jancsi Janko Diamond Hu Ziv Zane Zeke Wakeman Wye Muo Teletai Chohkmah Nesethrah Mercavah Nigel Seven Morningstar A. San Juan CCCII

Read more: [http://newsinfo.inquirer.net/412195/student-enrolls-using-41-names#ixzz50HJP2yDo](http://newsinfo.inquirer.net/412195/student-enrolls-using-41-names#ixzz50HJP2yDo) Follow us: @inquirerdotnet on Twitter | inquirerdotnet on Facebook

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 4, 2017, 8:24am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/6 "2017-12-04T08:24:43Z")

</div>

Not clear enough. Can you put each name on a separate line? Or separate them with commas?

---

<div class="post-metadata">

**Author:** ![zachraduban](https://talk.openmrs.org/letter_avatar/zachraduban/32/6_449c533f586939b6e5f246632a46421f.png) [@zachraduban](https://talk.openmrs.org/u/zachraduban)\
**Post date:** [December 4, 2017, 8:26am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/7 "2017-12-04T08:26:38Z")

</div>

Given Name: “Ratziel Timshel Ismail Zerubbabel Zabud Zimry Pike Blavatsky Philo Judaeus Polidorus Isurenus Morya Nylghara Rakoczy Kuthumi Krishnamurti Ashram Jerram Akasha Aum Ultimus Rufinorum Jancsi Janko Diamond Hu Ziv Zane Zeke Wakeman Wye Muo Teletai Chohkmah Nesethrah Mercavah Nigel Seven Morningstar”

Middle Initial: “A.”

Family Name: “San Juan CCCII”

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 4, 2017, 8:34am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/8 "2017-12-04T08:34:08Z")

</div>

Is Given Name just one name? Or many names?

---

<div class="post-metadata">

**Author:** ![zachraduban](https://talk.openmrs.org/letter_avatar/zachraduban/32/6_449c533f586939b6e5f246632a46421f.png) [@zachraduban](https://talk.openmrs.org/u/zachraduban)\
**Post date:** [December 4, 2017, 8:39am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/9 "2017-12-04T08:39:18Z")

</div>

The given name is composed of many names.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 4, 2017, 8:49am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/10 "2017-12-04T08:49:54Z")

</div>

Is that for just one person?

---

<div class="post-metadata">

**Author:** ![zachraduban](https://talk.openmrs.org/letter_avatar/zachraduban/32/6_449c533f586939b6e5f246632a46421f.png) [@zachraduban](https://talk.openmrs.org/u/zachraduban)\
**Post date:** [December 4, 2017, 9:09am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/11 "2017-12-04T09:09:34Z")

</div>

Yes. This is just for one person.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 4, 2017, 9:17am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/12 "2017-12-04T09:17:08Z")

</div>

I do not believe that there exists a real person with a given name of all this: “Ratziel Timshel Ismail Zerubbabel Zabud Zimry Pike Blavatsky Philo Judaeus Polidorus Isurenus Morya Nylghara Rakoczy Kuthumi Krishnamurti Ashram Jerram Akasha Aum Ultimus Rufinorum Jancsi Janko Diamond Hu Ziv Zane Zeke Wakeman Wye Muo Teletai Chohkmah Nesethrah Mercavah Nigel Seven Morningstar”

I think that is fiction! 😄

---

<div class="post-metadata">

**Author:** ![lluismf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/lluismf/32/770_2.png) [@lluismf](https://talk.openmrs.org/u/lluismf)\
**Post date:** [December 4, 2017, 9:18am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/13 "2017-12-04T09:18:11Z")

</div>

Are you trolling us?

---

<div class="post-metadata">

**Author:** ![zachraduban](https://talk.openmrs.org/letter_avatar/zachraduban/32/6_449c533f586939b6e5f246632a46421f.png) [@zachraduban](https://talk.openmrs.org/u/zachraduban)\
**Post date:** [December 4, 2017, 11:51am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/14 "2017-12-04T11:51:07Z")

</div>

It is not fiction. I pasted a link as proof. I shouldn’t have used an exaggerated example. But whether you believe it or not, there are instances that given names can exceed the 50 character count.

But anyway, I just wanted to know if changing of the character count is allowed, and if it will work or not. I also want to know that if I change it, would there be any bad effects?

---

<div class="post-metadata">

**Author:** ![zachraduban](https://talk.openmrs.org/letter_avatar/zachraduban/32/6_449c533f586939b6e5f246632a46421f.png) [@zachraduban](https://talk.openmrs.org/u/zachraduban)\
**Post date:** [December 4, 2017, 11:54am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/15 "2017-12-04T11:54:04Z")

</div>

No sir, I am not trolling anyone. The example that I used might have been an exaggeration, but it is true.

Anyway, I was just asking a simple question on the possibility of changing the character count of a column in a database table, and wondering if it will work, and would there be any bad effects if ever I did.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 4, 2017, 11:59am UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/16 "2017-12-04T11:59:46Z")

</div>

My recommendation is that do not do anything. Assume all names will fit in the current character limit. If a time comes when you have a name which does not fit, then get back to us for advice. 🙂

One of the lessons i have learn’t over time is that some times we waste time doing certain things in anticipation of what never actually happens.

---

<div class="post-metadata">

**Author:** ![lluismf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/lluismf/32/770_2.png) [@lluismf](https://talk.openmrs.org/u/lluismf)\
**Post date:** [December 4, 2017, 12:46pm UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/17 "2017-12-04T12:46:20Z")

</div>

Changing a database column to make it wider almost always requires a UI change. But even if that person (whose parent should be sent to prison) is a OpenMRS patient, just put Ratziel as first name and it’ll be ok because it’s not an identifier.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 4, 2017, 1:03pm UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/18 "2017-12-04T13:03:03Z")

</div>

And this will also get in your way:

> <https://github.com/openmrs/openmrs-core/blob/master/api/src/main/resources/org/openmrs/api/db/hibernate/PersonName.hbm.xml#L49-L50>

Together with: [https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/validator/PersonNameValidator.java#L154-L155](https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/validator/PersonNameValidator.java#L154-L155)

---

<div class="post-metadata">

**Author:** ![willa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/willa/32/256_2.png) [@willa](https://talk.openmrs.org/u/willa)\
**Post date:** [December 5, 2017, 2:50pm UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/19 "2017-12-05T14:50:13Z")

</div>

@zachraduban is that multiple given names or just one given name? In other words, in a normal conversation does anyone refer to this guy using all those names at once? Like for example “ **HEY** Ratziel Timshel Ismail Zerubbabel Zabud Zimry Pike Blavatsky Philo Judaeus Polidorus Isurenus Morya Nylghara Rakoczy Kuthumi Krishnamurti Ashram Jerram Akasha Aum Ultimus Rufinorum Jancsi Janko Diamond Hu Ziv Zane Zeke Wakeman Wye Muo Teletai Chohkmah Nesethrah Mercavah Nigel Seven Morningstar **DID YOU HAVE YOUR BREAKFAST**?”. (I had to cap and bold to separate the name from other non-name words).

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [December 5, 2017, 10:04pm UTC](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/20 "2017-12-05T22:04:14Z")

</div>

> [@zachraduban](#):
>
> May I change the character limit for a certain column in the OpenMRS database tables? Is it allowed? Will it work? Are there any bad effects?

Since this conversation got a bit sidetracked by the example you gave…

The specific answer is what Daniel said in post 18: [Modifying OpenMRS database table column character count - #18 by dkayiwa](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384/18)

Changing the database column is not sufficient, you would also need to fork openmrs-core and make a matching change in the hibernate configuration.

I agree in principle that we should have wider DB columns for names. Out of 7 billion people in the world, there are some cultures with very long names. And an individual implementation can enforce shorter names via the name validation regex setting. In practice I wouldn’t prioritize this change unless there’s a non-hypothetical request for it. (Of course PRs are always welcome if you’re inspired to address this!)

[Next page](https://talk.openmrs.org/t/modifying-openmrs-database-table-column-character-count/14384.md?page=2)
