在Magento 2.2上添加额外产品属性的正确方法

i am fairly new at Magento development ( coming from Wordpress and Prestashop development ) although i have a fairly good amount of experience in PHP.

My goal is to add an extra "attribute", an "extra" sku in particular. I've been wandering around articles and tutorials with no luck, some of them was about creating the attribute in InstallData class and some of them about creating a product_form.xml in adminhtml.

All the work is being done in a new module.

Non of them worked, i've only had the change to see my new field with the .xml method, but then i wasn't able to save values in database.

Finally i've never managed to create a new entry in eav_attribute table ( been doing bin/magento setup:upgrade for ages ).

I'll post the two files i have so far bellow.

Something changed in 2.2 ( so the examples i've found online doesn't work ) ?

We ( referring to every developer trying to learn Magento ways ) would be more than thankful if someone explained the whole logic and steps in order to add this one "meta" to the products.

Thanks in advance

My product_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="extra_attributes">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Extra Attributes</item>
            <item name="sortOrder" xsi:type="number">90</item>
        </item>
    </argument>
    <field name="extra_code">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Extra Code</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="sortOrder" xsi:type="number">10</item>
                <item name="dataScope" xsi:type="string">mtrl</item>
                <item name="notice" xsi:type="string" translate="true">Softone Internal Id</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>
</fieldset>

InstallData.php

class InstallData implements InstallDataInterface {

private $eavSetupFactory;

public function __construct( EavSetupFactory $eavSetupFactory ) {
    $this->eavSetupFactory = $eavSetupFactory; 
}

public function install(
    ModuleDataSetupInterface $setup,
    ModuleContextInterface $context
) {
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY, 'extra_attribute', [
        'type' => 'text',
        'label' => 'ExtraAttribute',
        'input' => 'text',
        'group' => 'General',
        'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
        'visible' =>    true,
        'required' => true,
        'user_defined' => true,
        'default' => '1',
        'unique' => false
        ]
    );
}

}