increase varchar length in existing table

79 views
Skip to first unread message

Crispian Blackbourn

unread,
Feb 11, 2023, 5:10:18 AM2/11/23
to IDempiere
Hi ,

I have a need to increase the 'vendor_category' column in 'm_product_po' from 30 to 35.

Is it safe to just do so with 'System' user in 'table and field' and 'window and column' and synchronize the database only ?

Or do I need to alter classes as well and if so which ones? (I don't really want to alter the core if I can avoid it and creating a plugin for it seems overkill?)

Regards

Crispian

Heng Sin Low

unread,
Feb 11, 2023, 5:59:37 AM2/11/23
to idem...@googlegroups.com
It is fine to do that without changing any classes.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/1702870414.268176.1676110210302%40mail.yahoo.com.

Crispian Blackbourn

unread,
Feb 11, 2023, 6:04:31 AM2/11/23
to idem...@googlegroups.com

Andres Lopez Andrade

unread,
Feb 13, 2023, 9:04:17 PM2/13/23
to iDempiere
Crispian

There’s just one little issue that you have to be aware off, when you want to migrate next versions, check the migration files before, I’ll give you an example, on version 6 I increased the description file on c_invoiceline table, from 250 to 2000, when I migrated to version 8 there was a file that change NVARCHAR2 to VARCHAR2 and replace de size of the field, I lost my description data, well I’ve a backup but then I realized that was the column that return to 250, so, document that changes and check the migration files before run it.

Happy customization!

Regards,

Andres

Carlos Antonio Ruiz Gomez

unread,
Feb 14, 2023, 4:41:48 AM2/14/23
to idem...@googlegroups.com
Hi Andrés,

Exactly for the case you describe is why I developed this new feature:

It's intended to apply on a test environment to discover which customizations can be potentially destroyed by migration scripts


> when I migrated to version 8 there was a file that change NVARCHAR2 to VARCHAR2 and replace de size of the field, I lost my description data

Data loss sounds surprising, oracle has protection against that:
* ALTER table throws error ORA-01441: cannot decrease column length because some value is too big
* INSERT throws error ORA-12899: value too large for column

Regards,

Carlos Ruiz




En 14/02/23 03:04, Andres Lopez Andrade escribió:

Carlos Antonio Ruiz Gomez

unread,
Feb 14, 2023, 4:45:01 AM2/14/23
to idem...@googlegroups.com
Ah, I just saw what you mean!!

The script throws the error ORA-12899, but still continues and destroy the values of the Description.

That emphasize what you said - it is really important first to run migration in a test database and check for errors before applying in production.

Regards,

Carlos Ruiz

Crispian Blackbourn

unread,
Feb 14, 2023, 6:13:13 AM2/14/23
to idem...@googlegroups.com
Hi Andres & Carlos,

thank you for the extra information.

Something to be mindful of in the future.

Crispian


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit
Reply all
Reply to author
Forward
0 new messages