pierre@0: . pierre@0: */ pierre@0: pierre@0: /** pierre@0: * Implementation of hook_schema(). pierre@0: */ pierre@0: function ad_owners_schema() { pierre@0: $schema['ad_owners'] = array( pierre@0: 'description' => 'Stores information about ad owners. Every ad can have one or more owners.', pierre@0: 'fields' => array( pierre@0: 'oid' => array( pierre@0: 'type' => 'serial', pierre@0: 'not null' => TRUE, pierre@0: 'unsigned' => TRUE, pierre@0: 'description' => 'Unique owner pair ID.', pierre@0: ), pierre@0: 'aid' => array( pierre@0: 'type' => 'int', pierre@0: 'not null' => TRUE, pierre@0: 'unsigned' => TRUE, pierre@0: 'default' => 0, pierre@0: 'description' => 'Ad id.', pierre@0: ), pierre@0: 'uid' => array( pierre@0: 'type' => 'int', pierre@0: 'not null' => TRUE, pierre@0: 'unsigned' => TRUE, pierre@0: 'default' => 0, pierre@0: 'description' => 'The {users}.uid that owns ad.', pierre@0: ), pierre@0: ), pierre@0: 'primary key' => array('oid'), pierre@0: 'indexes' => array( pierre@0: 'aid' => array('aid'), pierre@0: 'uid' => array('uid'), pierre@0: ), pierre@0: ); pierre@0: pierre@0: /** pierre@0: * Permissions can be granted to each owner of each ad. The same owner pierre@0: * can own multiple ads, and can have different permissions for each ad. pierre@0: */ pierre@0: $schema['ad_permissions'] = array( pierre@0: 'description' => 'Permissions can be granted to each owner of each ad. The same owner can own multiple ads, and can have different permissions for each ad.', pierre@0: 'fields' => array( pierre@0: 'oid' => array( pierre@0: 'type' => 'int', pierre@0: 'not null' => TRUE, pierre@0: 'unsigned' => TRUE, pierre@0: 'default' => 0, pierre@0: 'description' => 'Owner pair ID.', pierre@0: ), pierre@0: 'permissions' => array( pierre@0: 'type' => 'text', pierre@0: 'not null' => FALSE, pierre@0: 'size' => 'big', pierre@0: 'description' => 'Ad permission info.', pierre@0: ), pierre@0: ), pierre@0: 'primary key' => array('oid'), pierre@0: ); pierre@0: pierre@1: /** pierre@1: * The ad_hosts table is used to configure users that can display ads pierre@1: * remotely. pierre@1: */ pierre@1: $schema['ad_hosts'] = array( pierre@1: 'description' => 'The ad_hosts table is used to configure users that can display ads remotely. ', pierre@1: 'fields' => array( pierre@1: 'uid' => array( pierre@1: 'type' => 'int', pierre@1: 'not null' => TRUE, pierre@1: 'unsigned' => TRUE, pierre@1: 'default' => 0, pierre@1: 'description' => '', pierre@1: ), pierre@1: 'hostid' => array( pierre@1: 'type' => 'varchar', pierre@1: 'length' => 32, pierre@1: 'not null' => TRUE, pierre@1: 'default' => '', pierre@1: 'description' => 'Host from which acion was made.', pierre@1: ), pierre@1: 'status' => array( pierre@1: 'type' => 'int', pierre@1: 'size' => 'tiny', pierre@1: 'not null' => TRUE, pierre@1: 'unsigned' => TRUE, pierre@1: 'default' => 0, pierre@1: 'description' => '', pierre@1: ), pierre@1: 'description' => array( pierre@1: 'type' => 'text', pierre@1: 'not null' => FALSE, pierre@1: 'description' => 'Host from which acion was made.', pierre@1: ), pierre@1: ), pierre@1: 'primary key' => array('uid'), pierre@1: 'indexes' => array( pierre@1: 'status' => array('status'), pierre@1: 'hostid' => array('hostid'), pierre@1: ), pierre@1: ); pierre@1: pierre@0: return $schema; pierre@0: } pierre@0: pierre@0: /** pierre@0: * ad_external module installation. pierre@0: */ pierre@0: function ad_owners_install() { pierre@0: drupal_install_schema('ad_owners'); pierre@0: } pierre@0: pierre@0: /** pierre@0: * Allow complete uninstallation of the ad_external module. pierre@0: */ pierre@0: function ad_owners() { pierre@0: drupal_uninstall_schema('ad_owners'); pierre@0: }