You are here

function availability_calendars_install in Availability Calendars 5

Same name and namespace in other branches
  1. 6.2 availability_calendars.install \availability_calendars_install()
  2. 6 availability_calendars.install \availability_calendars_install()
  3. 7.2 availability_calendars.install \availability_calendars_install()

Implementation of hook_install().

File

./availability_calendars.install, line 10

Code

function availability_calendars_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("\n       CREATE TABLE {availability_calendars_day} (\n         nid int unsigned NOT NULL,\n         year int unsigned NOT NULL,\n         month int unsigned NOT NULL,\n         day int unsigned NOT NULL,\n         status int unsigned\n       ) /*!40100 DEFAULT CHARACTER SET utf8 */\n     ");
      db_query("\n       CREATE TABLE {availability_calendars_week} (\n         nid int unsigned NOT NULL,\n         year int unsigned NOT NULL,\n         month int unsigned NOT NULL,\n         week int unsigned NOT NULL,\n         note varchar(64)\n       ) /*!40100 DEFAULT CHARACTER SET utf8 */\n     ");
      break;
    case 'pgsql':
      drupal_set_message(t('Sorry, there is no pgsql support at present.'));
      break;
  }
}