node_example_schema
developer/examples/node_example.install, строка 20
- Версии
- 6
node_example_schema()
Реализация hook_schema()
.
Код
<?php
function node_example_schema() {
$schema['node_example'] = array(
'fields' => array(
'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'color' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
'quantity' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
),
'primary key' => array('vid', 'nid'),
);
return $schema;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии