Skip to content

Commit

Permalink
Remove dead column
Browse files Browse the repository at this point in the history
Add some documentation.
  • Loading branch information
blackcoder87 committed Jan 22, 2019
1 parent 6ea9ebe commit adcb2f3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions application/modules/admin/config/config.php
Expand Up @@ -476,6 +476,10 @@ public function getUpdate($installedVersion)
removeDir(ROOT_PATH.'/vendor');
rename(ROOT_PATH.'/_vendor', ROOT_PATH.'/vendor');
break;
case "2.1.19":
// Remove no longer used column.
$this->db()->query('ALTER TABLE `[prefix]_media` DROP COLUMN `cat_name`;');
break;
}

return 'Update function executed.';
Expand Down
21 changes: 21 additions & 0 deletions application/modules/events/mappers/Events.php
Expand Up @@ -97,6 +97,8 @@ public function getEventById($id)
}

/**
* Get list of upcoming events.
*
* @param null $limit
* @return EventMapper[]|array
* @throws \Ilch\Database\Exception
Expand Down Expand Up @@ -127,6 +129,9 @@ public function getEventListUpcoming($limit = null)
}

/**
* Get list of events a user participates in.
*
* @param $userId
* @return EventMapper[]|array
*/
public function getEventListParticipation($userId)
Expand All @@ -152,6 +157,8 @@ public function getEventListParticipation($userId)
}

/**
* Get list of past events.
*
* @param null $limit
* @return EventMapper[]|array
* @throws \Ilch\Database\Exception
Expand Down Expand Up @@ -181,6 +188,13 @@ public function getEventListPast($limit = null)
return $events;
}

/**
* Get a list of the current events.
*
* @param null $limit
* @return array|null
* @throws \Ilch\Database\Exception
*/
public function getEventListCurrent($limit = null)
{
$eventMapper = new EventMapper();
Expand All @@ -206,6 +220,13 @@ public function getEventListCurrent($limit = null)
return $events;
}

/**
* Check if table exists.
*
* @param $table
* @return false|true
* @throws \Ilch\Database\Exception
*/
public function existsTable($table)
{
$module = $this->db()->ifTableExists('[prefix]_'.$table);
Expand Down
1 change: 0 additions & 1 deletion application/modules/media/config/config.php
Expand Up @@ -46,7 +46,6 @@ public function getInstallSql()
`url_thumb` VARCHAR(255) NOT NULL DEFAULT 0,
`ending` VARCHAR(5) NOT NULL DEFAULT 0,
`datetime` DATETIME NOT NULL,
`cat_name` VARCHAR(100) NOT NULL,
`cat` INT(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1;
Expand Down

0 comments on commit adcb2f3

Please sign in to comment.