Pol*_*les 7 php mysql ddl magento
我在magento mysql安装或升级脚本中看到过,他们使用以下命令添加列:
$installer->getTable('catalog/eav_attribute'),
'tooltip',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'nullable' => true,
'comment' => 'Tooltip'
)
Run Code Online (Sandbox Code Playgroud)
我想知道什么是Varien_Db_Ddl_Table :: TYPE_TEXT?如果我想在mysql表中手动添加工具提示列,那么我应该在类型部分中使用什么?它只是' TEXT '吗?
Mee*_*m R 23
Varien_Db_Ddl_Table::TYPE_TEXT 就像列的类型一样 char, varchar,int,tinyint,etc.,
你使用以下任何人输入.
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
Run Code Online (Sandbox Code Playgroud)
获取更多信息参考 lib\Varien\Db\Ddl\Table.php