HowHere is the work i did.
app/code/Custom/OverrideCompany/view/base/ui_component/company_form.xml
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="general">
<field name="account_number" formElement="input">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="disabled" xsi:type="boolean">true</item>
<item name="source" xsi:type="string">Account Number</item>
</item>
</argument>
<settings>
<validation>
<rule name="required-entry" xsi:type="boolean">true</rule>
</validation>
<dataType>text</dataType>
<label translate="true">Account Number</label>
<dataScope>account_number</dataScope>
</settings>
</field>
</fieldset>
</form>
app/code/Custom/OverrideCompany/Setup/InstallSchema.php
<?php
namespace Custom\OverrideCompany\Setup;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;
class InstallSchema implements InstallSchemaInterface {
const COMPANY_TABLE_NAME = 'company';
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context){
$setup->startSetup();
$table = $setup->getTable(self::COMPANY_TABLE_NAME);
$columns = [
'account_number',
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
'length' => 11,
'nullable' => true,
'comment' => 'Account Number'
],
];
$connection = $setup->getConnection();
foreach ($columns as $col_name => $col_array){
$connection->addColumn($table, $col_name, $col_array);
}
$setup->endSetup();
}
}
app/code/Custom/OverrideCompany/Setup/UpgradeSchema.php
<?php
namespace Custom\OverrideCompany\Setup;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
class UpgradeSchema implements UpgradeSchemaInterface
{
/**
* {@inheritdoc}
*/
public function upgrade(
SchemaSetupInterface $setup,
ModuleContextInterface $context
) {
$installer = $setup;
$installer->startSetup();
if (version_compare($context->getVersion(), '1.0.0', '<')) {
$installer->getConnection()->addColumn(
$installer->getTable('company'),
'account_number',
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
'length' => 11,
'nullable' => true,
'comment' => 'Account Number'
]
);
}
$installer->endSetup();
}
}