function signup_schema in Signup 6.2
Same name and namespace in other branches
- 6 signup.install \signup_schema()
- 7 signup.install \signup_schema()
Implementation of hook_schema().
1 call to signup_schema()
- signup_update_6200 in ./
signup.install - Create the {signup_panes} table, enable the signup_basic_form module, and add the basic form to all existing nodes.
File
- ./
signup.install, line 7
Code
function signup_schema() {
$schema['signup'] = array(
'description' => t('Signup module per-node settings.'),
'fields' => array(
'nid' => array(
'description' => t('Primary key: node ID'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'forwarding_email' => array(
'description' => t('Email address to send signup notifications to.'),
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
),
'send_confirmation' => array(
'description' => t('Boolean indicating whether confirmation emails should be sent.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'confirmation_email' => array(
'description' => t('Email template to send to users when they signup.'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'send_reminder' => array(
'description' => t('Boolean indicating whether reminder emails should be sent. This is set to 0 once the reminders are sent.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'reminder_days_before' => array(
'description' => t('Number of days before the start of a time-based node when the reminder emails should be sent.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'reminder_email' => array(
'description' => t('Email template to send to users to remind them about a signup.'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'close_in_advance_time' => array(
'description' => t('Number of hours before the start of a time-based node when signups should automatically be closed. This column is not currently used and the behavior is controlled by a site-wide setting. See http://drupal.org/node/290249 for more information.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'close_signup_limit' => array(
'description' => t('Maximum number of users who can signup before signups are closed. If set to 0, there is no limit.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'status' => array(
'description' => t('Boolean indicating if signups are open (1) or closed (0) for the given node'),
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
),
'primary key' => array(
'nid',
),
);
$schema['signup_log'] = array(
'description' => t('Records information for each user who signs up for a node.'),
'fields' => array(
'sid' => array(
'description' => t('Primary key: signup ID'),
'type' => 'serial',
'size' => 'normal',
'unsigned' => TRUE,
'not null' => TRUE,
),
'uid' => array(
'description' => t('Key: the user ID of the user who signed up.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'nid' => array(
'description' => t('Key: the node ID of the node the user signed up for.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'anon_mail' => array(
'description' => t('The email address for an anonymous user who signed up, or an empty string for authenticated users.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'signup_time' => array(
'description' => t('Integer timestamp of when the user signed up for the node.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'form_data' => array(
'description' => t('Serialized string of additional signup form values. See hook_signup_pane_info() for more information.'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'attended' => array(
'description' => t('Did this user actually attend the node they signed up for?'),
'type' => 'int',
'size' => 'tiny',
),
'count_towards_limit' => array(
'description' => t('How many slots (if any) this signup should use towards the total signup limit for this node'),
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
),
'primary key' => array(
'sid',
),
'indexes' => array(
'uid' => array(
'uid',
),
'nid' => array(
'nid',
),
),
);
$schema['signup_panes'] = array(
'description' => t('Signup panes for each signup node.'),
'fields' => array(
'nid' => array(
'description' => t('Node ID'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'pane_id' => array(
'description' => t('Pane ID as defined by hook_signup_pane_info().'),
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'callback' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => "The name of the function that renders the pane.",
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'The weight of this pane in relation to other panes for the node.',
),
),
'indexes' => array(
'nid' => array(
'nid',
),
),
'unique keys' => array(
'nid_pane_id' => array(
'nid',
'pane_id',
),
),
);
return $schema;
}