public function migrateUp(MigrationConfig $config, $flushDatabase = false)
	{
		$migrations = $this->instantiateMigrations($config);
		
		if(empty($migrations))
		{
			$skip = false;
		}
		else
		{
			$skip = $this->platform->hasTable('#__kk_migrations');
				
			if($skip)
			{
				$params = [];
				$in = [];
		
				$mtime = clone $this->date;
		
				foreach(array_values($migrations) as $i => $migration)
				{
					$in[] = ':v' . $i;
					$params['v' . $i] = $migration->getVersion();
					$date = new \DateTime('@' . filemtime((new \ReflectionClass(get_class($migration)))->getFileName()));
						
					if($date > $mtime)
					{
						$mtime = $date;
					}
				}
		
				$stmt = $this->conn->prepare(sprintf("SELECT COUNT(*) AS cnt, MAX(`migrated`) AS mtime FROM `#__kk_migrations` WHERE `version` IN (%s)", implode(', ', $in)));
				$stmt->bindAll($params);
				$stmt->execute();
		
				// Only skip migrations if all of them are alreay migrated up.
				$row = $stmt->fetchNextRow();
				$dbcnt = (int)$row['cnt'];
				$dbmtime = \DateTime::createFromFormat('YmdHis', $row['mtime']);
		
				$skip = (count($params) === $dbcnt) && ($dbmtime > $mtime);
			}
		}
		
		if(!$skip)
		{
			if($flushDatabase)
			{
				$this->platform->flushDatabase();
			}
				
			foreach($migrations as $migration)
			{
				$this->executeMigrationUp($migration);
			}
		}
		
		if($skip && $flushDatabase)
		{
			$this->platform->flushData();
		}
	}