public function createAuditedTable($table, $columns, $options=null,
		$createdField='created', $createdByField='created_by',
		$updatedField='updated', $updatedByField='updated_by',
		$userTableName='{{%user}}', $userIdField='id',
		$createdOnDelete='SET NULL', $updatedOnDelete='SET NULL')
	{
		//first create the table
		$this->createTable($table, $columns, $options);

		//alter table and add audit fields
		$this->addColumn($table, $createdField, Schema::TYPE_INTEGER);
		$this->addColumn($table, $createdByField, Schema::TYPE_INTEGER);
		$this->addColumn($table, $updatedField, Schema::TYPE_INTEGER);
		$this->addColumn($table, $updatedByField, Schema::TYPE_INTEGER);

		//get actual table names
		$tableNameThis = $this->db->quoteSql($table);
		$tableNameUser = $this->db->quoteSql($userTableName);

		//create names for created and updated by relations
		$str = 'FK_%s_%s_%s';
		$fkCreatedBy = str_replace('`', '', sprintf($str, $tableNameThis, $tableNameUser, 'created'));
		$fkUpdatedBy = str_replace('`', '', sprintf($str, $tableNameThis, $tableNameUser, 'updated'));

		//create the foreign keys
		$this->addForeignKey($fkCreatedBy, $table, $createdByField, $userTableName, $userIdField, $createdOnDelete, 'CASCADE');
		$this->addForeignKey($fkUpdatedBy, $table, $updatedByField, $userTableName, $userIdField, $updatedOnDelete, 'CASCADE');
	}