<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Field type standardisation in Charts char => varchar]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=5451</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5451&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Field type standardisation in Charts char => varchar.]]></description>
		<lastBuildDate>Wed, 07 Jan 2015 20:56:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Field type standardisation in Charts char => varchar]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=22080#p22080</link>
			<description><![CDATA[<p>In the standard <strong>en_US-new.sql</strong> and <strong>en_US-demo.sql</strong> Charts of Accounts, there are many fields that should be <strong>varchar</strong> and not <strong>char</strong>.</p><p>Here are the set of SQL statements that can be safely executed in most recent FA v2.3 installs and can be ported to the FA v2.4 branch as well.<br /></p><div class="codebox"><pre><code>ALTER TABLE `0_bom` 
    CHANGE `parent` `parent` VARCHAR(20) DEFAULT &#039;&#039; NOT NULL, 
    CHANGE `component` `component` VARCHAR(20) DEFAULT &#039;&#039; NOT NULL, 
    DROP INDEX `parent`, 
    DROP PRIMARY KEY, ADD PRIMARY KEY (`parent`, `loc_code`, `component`, `workcentre_added`); 

ALTER TABLE `0_credit_status` CHANGE `reason_description` `reason_description` VARCHAR(100) DEFAULT &#039;&#039; NOT NULL;
ALTER TABLE `0_payment_terms` CHANGE `terms` `terms` VARCHAR(80) DEFAULT &#039;&#039; NOT NULL;

ALTER TABLE `0_purch_data` 
    CHANGE `suppliers_uom` `suppliers_uom` VARCHAR(50) DEFAULT &#039;&#039; NOT NULL, 
    CHANGE `supplier_description` `supplier_description` VARCHAR(50) DEFAULT &#039;&#039; NOT NULL;

ALTER TABLE `0_sales_types` CHANGE `sales_type` `sales_type` VARCHAR(50) DEFAULT &#039;&#039; NOT NULL;

ALTER TABLE `0_salesman` 
    CHANGE `salesman_name` `salesman_name` VARCHAR(60) DEFAULT &#039;&#039; NOT NULL, 
    CHANGE `salesman_phone` `salesman_phone` VARCHAR(30) DEFAULT &#039;&#039; NOT NULL, 
    CHANGE `salesman_fax` `salesman_fax` VARCHAR(30) DEFAULT &#039;&#039; NOT NULL;

ALTER TABLE `0_stock_moves` CHANGE `reference` `reference` VARCHAR(40) DEFAULT &#039;&#039; NOT NULL;

ALTER TABLE `0_workcentres` 
    CHANGE `name` `name` VARCHAR(40) DEFAULT &#039;&#039; NOT NULL, 
    CHANGE `description` `description` VARCHAR(50) DEFAULT &#039;&#039; NOT NULL;</code></pre></div><p>ll these and more are available in <a href="https://github.com/apmuthu/frontaccounting/blob/master/FAMods/sql/alter_to_latest2.3.sql">my GitHub FAMods</a> folder.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 07 Jan 2015 20:56:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=22080#p22080</guid>
		</item>
	</channel>
</rss>
