You are here

asset_youtube.install in Asset 5

Same filename and directory in other branches
  1. 6 asset_youtube/asset_youtube.install

File

asset_youtube/asset_youtube.install
View source
<?php

/**
 * Implementation of hook_install()
 */
function asset_youtube_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {asset_youtube_user} (\n        uid int(10) unsigned NOT NULL,\n        username varchar(128) NOT NULL default '',\n        PRIMARY KEY  (uid)\n      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {asset_youtube_user} (\n        uid SERIAL,\n        username varchar(128) NOT NULL default '',\n        PRIMARY KEY (uid)\n      )");
      break;
  }
  drupal_set_message(t('Asset YouTube tables have been configured.'));
}
function asset_youtube_update_1() {
  $ret[] = update_sql("UPDATE {asset} SET type='youtube' WHERE extension = 'youtube'");
  return $ret;
}
function asset_youtube_uninstall() {
  db_query('DROP TABLE {asset_youtube_user}');
}