What is Varien_Db_Ddl_Table :: TYPE_TEXT in mysql / magento

I saw in the magento mysql install or upgrade script where they add a column using:

$installer->getTable('catalog/eav_attribute'), 'tooltip', array( 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, 'nullable' => true, 'comment' => 'Tooltip' ) 

I want to know what is Varien_Db_Ddl_Table :: TYPE_TEXT? If I want to add a tooltip column manually in the mysql table, then what should I use in the type section? Is this just a TEXT ?

+7
php mysql ddl magento
source share
2 answers

Varien_Db_Ddl_Table::TYPE_TEXT is nothing more than a column type like char, varchar,int,tinyint,etc.,

you use any type in the following.

 const TYPE_BOOLEAN = 'boolean'; const TYPE_SMALLINT = 'smallint'; const TYPE_INTEGER = 'integer'; const TYPE_BIGINT = 'bigint'; const TYPE_FLOAT = 'float'; const TYPE_NUMERIC = 'numeric'; const TYPE_DECIMAL = 'decimal'; const TYPE_DATE = 'date'; const TYPE_TIMESTAMP = 'timestamp'; // Capable to support date-time from 1970 + auto-triggers in some RDBMS const TYPE_DATETIME = 'datetime'; // Capable to support long date-time before 1970 const TYPE_TEXT = 'text'; const TYPE_BLOB = 'blob'; // Used for back compatibility, when query param can't use statement options const TYPE_VARBINARY = 'varbinary'; // A real blob, stored as binary inside DB // Deprecated column types, support is left only in MySQL adapter. const TYPE_TINYINT = 'tinyint'; // Internally converted to TYPE_SMALLINT const TYPE_CHAR = 'char'; // Internally converted to TYPE_TEXT const TYPE_VARCHAR = 'varchar'; // Internally converted to TYPE_TEXT const TYPE_LONGVARCHAR = 'longvarchar'; // Internally converted to TYPE_TEXT const TYPE_CLOB = 'cblob'; // Internally converted to TYPE_TEXT const TYPE_DOUBLE = 'double'; // Internally converted to TYPE_FLOAT const TYPE_REAL = 'real'; // Internally converted to TYPE_FLOAT const TYPE_TIME = 'time'; // Internally converted to TYPE_TIMESTAMP const TYPE_BINARY = 'binary'; // Internally converted to TYPE_BLOB const TYPE_LONGVARBINARY = 'longvarbinary'; // Internally converted to TYPE_BLOB 

for more information see lib\Varien\Db\Ddl\Table.php

+22
source share

I had the same doubt in magento 2, later I found an ad in table.php in \ vendor \ magento \ framework \ DB \ Ddl \ Table.php

0
source share

All Articles