Use alter table to rename tables

For some strange reason using "rename table" causes an exception in
system/database/DB_driver.php:query() because
it trys to call num_rows() on a boolean. Using "alter table" works.

According to the php manpage mysqli::query() it should return a boolean
too, but whatever...

Signed-off-by: Florian Pritz <753f544d2d01592750fb4bd29251b78abcfc8ecd@xinu.at>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Repurpose_invitations extends CI_Migration {

	public function up()
	{
		$this->db->query("
			ALTER TABLE `invitations`
				ADD `action` VARCHAR(255) NOT NULL,
				ADD `data` TEXT NULL,
				ADD INDEX `action` (`action`);
		");

		$this->db->query("
			UPDATE `invitations` SET `action` = 'invitation' WHERE `action` = '';
		");

		$this->db->query("
			ALTER TABLE `invitations` RENAME `actions`;
		");

	}

	public function down()
	{
		$this->db->query("
			ALTER TABLE `actions` RENAME `invitations`;
		");

		$this->db->query("
			ALTER TABLE `invitations`
				DROP `action`,
				DROP `data`;
		");
	}
}

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Repurpose_invitations extends CI_Migration {

	public function up()
	{
		$this->db->query("
			ALTER TABLE `invitations`
				ADD `action` VARCHAR(255) NOT NULL,
				ADD `data` TEXT NULL,
				ADD INDEX `action` (`action`);
		");

		$this->db->query("
			UPDATE `invitations` SET `action` = 'invitation' WHERE `action` = '';
		");

		$this->db->query("
			RENAME TABLE `invitations` TO `actions` ;
		");

	}

	public function down()
	{
		$this->db->query("
			RENAME TABLE `actions` TO `invitations` ;
		");

		$this->db->query("
			ALTER TABLE `invitations`
				DROP `action`,
				DROP `data`;
		");
	}
}
