Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Barth committed Oct 10, 2010
0 parents commit 2c31266
Show file tree
Hide file tree
Showing 4 changed files with 1,169 additions and 0 deletions.
10 changes: 10 additions & 0 deletions legacy_reference.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; $Id: text.info,v 1.8 2010/08/16 20:57:22 dries Exp $
name = Text
description = Defines simple text field types.
package = Core
version = VERSION
core = 7.x
dependencies[] = field
files[] = text.module
files[] = text.test
required = TRUE
68 changes: 68 additions & 0 deletions legacy_reference.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
// $Id: text.install,v 1.2 2010/09/29 01:37:02 dries Exp $

/**
* @file
* Install, update and uninstall functions for the text module.
*/

/**
* Implements hook_field_schema().
*/
function text_field_schema($field) {
switch ($field['type']) {
case 'text':
$columns = array(
'value' => array(
'type' => 'varchar',
'length' => $field['settings']['max_length'],
'not null' => FALSE,
),
);
break;

case 'text_long':
$columns = array(
'value' => array(
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
);
break;

case 'text_with_summary':
$columns = array(
'value' => array(
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
'summary' => array(
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
);
break;
}
$columns += array(
'format' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
),
);
return array(
'columns' => $columns,
'indexes' => array(
'format' => array('format'),
),
'foreign keys' => array(
'format' => array(
'table' => 'filter_format',
'columns' => array('format' => 'format'),
),
),
);
}
Loading

0 comments on commit 2c31266

Please sign in to comment.