I got rid of the service replacement simply deleting it from services.yml and purging the cache (always to be done when you edit an .yml file there).
The class I created it's still there but's not called anymore. I will delete it.
I amended the migration file this way, that's just an exerpt of the real one.
Code: Select all
namespace threedi\ext\migrations;
class m1_install_user_schema extends \phpbb\db\migration\container_aware_migration
{
public function effectively_installed()
{
return $this->db_tools->sql_table_exists($this->table_prefix . 'blah');
}
static public function depends_on()
{
return array('\phpbb\db\migration\data\v31x\v314');
}
public function update_schema()
{
$float_type = array(
'mysql_41' => 'decimal(10, 5)',
'mysql_40' => 'decimal(10, 5)',
'mssql' => '[float]',
'mssqlnative' => '[float]',
'oracle' => 'number(10, 5)',
'sqlite' => 'decimal(10, 5)',
'sqlite3' => 'decimal(10, 5)',
'postgres' => 'decimal(10, 5)',
);
$tools = $this->container->get('dbal.tools');
foreach ($float_type as $sql_layer => $type)
{
$tools->dbms_type_map[$sql_layer]['FLOAT'] = $type;
}
return array(
'add_tables' => array(
$this->table_prefix . 'blah' => array(
'COLUMNS' => array(
'id' => array('UINT', null, 'auto_increment'),
'total' => array('FLOAT', '0'),
),
'PRIMARY_KEY' => 'id',
),
),
);
}
}
And I finally got what I was looking for, to translate
total float(10,5) NOT NULL default '0',
to a suitable DBAL datatype, here's the SQL export
total decimal(10,5) NOT NULL DEFAULT '0.00000',
and here's a cap from the DB .
Thanks kasimi and Javier, has been a very constructive discussion.
Marco.