Advertisement
DrupalCustom

install

Feb 10th, 2012
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.28 KB | None | 0 0
  1. <?php
  2. // $Id$
  3. /**
  4. * Implementation of hook_install().
  5. */
  6. function freeway_install() {
  7. drupal_install_schema('freeway');
  8. }
  9. /**
  10. * Implementation of hook_uninstall().
  11. */
  12. function freeway_uninstall() {
  13. drupal_uninstall_schema('freeway');
  14. }
  15.  
  16. function freeway_schema() {
  17. $schema['freeway'] = array(
  18. 'description' => t('Database for Freeway related activities'),
  19. 'fields' => array(
  20.  
  21.     'sr_id' => array(  
  22.     'description' => t('The serial initializer'),  
  23.     'type' => 'serial',    
  24.     'unsigned' => TRUE,    
  25.     'not null' => TRUE
  26.     ),
  27.    
  28.     'node_id' => array(
  29.         'type' => 'int',
  30.         'unsigned' => TRUE,
  31.         'not null' => TRUE,
  32.         'default' => 0,
  33.         'description' => t("The node ID"),
  34.     ),
  35.    
  36.     'file_id' => array(
  37.         'type' => 'int',
  38.         'unsigned' => TRUE,
  39.         'not null' => TRUE,
  40.         'default' => 0,
  41.         'description' => t("The File ID"),
  42.     ),
  43.    
  44.        
  45.     'project_id' => array(
  46.         'type' => 'int',
  47.         'unsigned' => TRUE,
  48.         'not null' => TRUE,
  49.         'default' => 0,
  50.         'description' => t("The File ID"),
  51.     ),
  52.    
  53.    
  54.    
  55.     'src_lang' => array(
  56.         'type' => 'varchar',
  57.         'length'=> 255,
  58.         'not null' => TRUE,
  59.         'default' => '0',
  60.         'description' => t("The source language"),
  61.     ),
  62.    
  63.    
  64.     'tar_lang' => array(
  65.         'type' => 'varchar',
  66.         'length'=> 255,
  67.         'not null' => TRUE,
  68.         'default' => '0',
  69.         'description' => t("The target language"),
  70.     ),
  71.    
  72.    
  73.     'node_title' => array(
  74.         'type' => 'varchar',
  75.         'length'=> 255,
  76.         'not null' => TRUE,
  77.         'default' => '0',
  78.         'description' => t("The node title"),
  79.     ),
  80.    
  81.     'node_body' => array(
  82.         'type' => 'text',
  83.         //'length'=> 255,
  84.         'not null' => TRUE,
  85.         //'default' => '0',
  86.         'description' => t("The node body"),
  87.     ),
  88. ),
  89. 'primary key' => array('sr_id'),
  90.  
  91. );
  92.  
  93. $schema['freeway_mode'] = array(
  94. 'description' => t('Database for Freeway mode'),
  95. 'fields' => array(
  96.     'sr_id' => array(  
  97.     'description' => t('The serial initializer'),  
  98.     'type' => 'serial',    
  99.     'unsigned' => TRUE,    
  100.     'not null' => TRUE
  101.     ),
  102.    
  103.     'mode_id' => array(
  104.     'type' => 'int',
  105.     'unsigned' => TRUE,
  106.     'not null' => TRUE,
  107.     'default' => 0,
  108.     'description' => t("The Mode Global or Non-Global"),
  109.     ),
  110.  
  111. ),
  112. 'primary key' => array('sr_id'),
  113. );
  114.  
  115. $schema['freeway_users'] = array(
  116. 'description' => t('Database for Freeway users'),
  117. 'fields' => array(
  118.     'sr_id' => array(  
  119.     'description' => t('The serial initializer'),  
  120.     'type' => 'serial',    
  121.     'unsigned' => TRUE,    
  122.     'not null' => TRUE
  123.     ),
  124.    
  125.     'drupal_username' => array(
  126.     'type' => 'varchar',
  127.     'length'=> 255,
  128.     'not null' => TRUE,
  129.     'default' => '0',
  130.     'description' => t("The Drupal Username"),
  131.     ),
  132.    
  133.    
  134.    
  135.     'freeway_username' => array(
  136.     'type' => 'varchar',
  137.     'length'=> 255,
  138.     'not null' => FALSE,
  139.     'default' => '0',
  140.     'description' => t("The Username"),
  141.     ),
  142.    
  143.     'freeway_password' => array(
  144.     'type' => 'varchar',
  145.     'length'=> 255,
  146.     'not null' => FALSE,
  147.     'default' => '0',
  148.     'description' => t("The Password"),
  149.     ),
  150.  
  151. ),
  152. 'primary key' => array('sr_id'),
  153. );
  154.  
  155. $schema['freeway_global_user'] = array(
  156. 'description' => t('Database for Freeway global user'),
  157. 'fields' => array(
  158.     'sr_id' => array(  
  159.     'description' => t('The serial initializer'),  
  160.     'type' => 'serial',    
  161.     'unsigned' => TRUE,    
  162.     'not null' => TRUE
  163.     ),
  164.    
  165.     'freeway_global_username' => array(
  166.     'type' => 'varchar',
  167.     'length'=> 255,
  168.     'not null' => TRUE,
  169.     'default' => '0',
  170.     'description' => t("The Global Username"),
  171.     ),
  172.    
  173.     'freeway_global_password' => array(
  174.     'type' => 'varchar',
  175.     'length'=> 255,
  176.     'not null' => TRUE,
  177.     'default' => '0',
  178.     'description' => t("The Global Password"),
  179.     ),
  180.    
  181.    
  182.  
  183. ),
  184. 'primary key' => array('sr_id'),
  185. );
  186.  
  187.  
  188. $schema['freeway_fileid'] = array(
  189. 'description' => t('Preserves File IDs of Freeway files'),
  190. 'fields' => array(
  191.     'sr_id' => array(  
  192.     'description' => t('The serial initializer'),  
  193.     'type' => 'serial',    
  194.     'unsigned' => TRUE,    
  195.     'not null' => TRUE
  196.     ),
  197.    
  198.     'freeway_file_id' => array(
  199.     'type' => 'varchar',
  200.     'length'=> 255,
  201.     'not null' => TRUE,
  202.     'default' => '0',
  203.     'description' => t("The File ID"),
  204.     ),
  205.    
  206.     'freeway_tar_lang' => array(
  207.     'type' => 'varchar',
  208.     'length'=> 255,
  209.     'not null' => TRUE,
  210.     'default' => '0',
  211.     'description' => t("The Target Language"),
  212.     ),
  213.    
  214.    
  215.  
  216. ),
  217. 'primary key' => array('sr_id'),
  218. );
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. return $schema;
  227. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement