<commit_before><?php

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

/**
 * Migration script for migrating joomla content
 **/
class Migration20130718000002Core extends Hubzero_Migration
{
	/**
	 * Up
	 **/
	protected static function up($db)
	{
		// Create assets table (all of this will only run the first time the table is created)
		if (!$db->tableExists('#__assets'))
		{
			$query = "CREATE  TABLE IF NOT EXISTS `#__assets` (
				`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
				`parent_id` INT(11) NOT NULL DEFAULT '0' ,
				`lft` INT(11) NOT NULL DEFAULT '0' ,
				`rgt` INT(11) NOT NULL DEFAULT '0' ,
				`level` INT(10) UNSIGNED NOT NULL ,
				`name` VARCHAR(50) NOT NULL ,
				`title` VARCHAR(100) NOT NULL ,
				`rules` VARCHAR(5120) NOT NULL ,
				PRIMARY KEY (`id`) ,
				UNIQUE INDEX `idx_asset_name` (`name` ASC) ,
				INDEX `idx_lft_rgt` (`lft` ASC, `rgt` ASC) ,
				INDEX `idx_parent_id` (`parent_id` ASC) )
			ENGINE = InnoDB
			DEFAULT CHARACTER SET = utf8
			COLLATE = utf8_general_ci;";

			$db->setQuery($query);
			$db->query();

			// Insert some default values
			$query = "INSERT INTO `#__assets` (`id`, `parent_id`, `lft`, `rgt`, `level`, `name`, `title`, `rules`)
			VALUES
				(1,0,0,0,0, 'root.1', 'Root Asset', '{\"core.login.site\":{\"6\":1,\"2\":1},\"core.login.admin\":{\"6\":1},\"core.admin\":{\"8\":1},\"core.manage\":{\"7\":1},\"core.create\":{\"6\":1,\"3\":1},\"core.delete\":{\"6\":1},\"core.edit\":{\"6\":1,\"4\":1},\"core.edit.state\":{\"6\":1,\"5\":1},\"core.edit.own\":{\"6\":1,\"3\":1}}'),<commit_msg>[H25] allow public login - needed for tmp_user login during 3rd party auth account creation<commit_after><?php

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

/**
 * Migration script for migrating joomla content
 **/
class Migration20130718000002Core extends Hubzero_Migration
{
	/**
	 * Up
	 **/
	protected static function up($db)
	{
		// Create assets table (all of this will only run the first time the table is created)
		if (!$db->tableExists('#__assets'))
		{
			$query = "CREATE  TABLE IF NOT EXISTS `#__assets` (
				`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
				`parent_id` INT(11) NOT NULL DEFAULT '0' ,
				`lft` INT(11) NOT NULL DEFAULT '0' ,
				`rgt` INT(11) NOT NULL DEFAULT '0' ,
				`level` INT(10) UNSIGNED NOT NULL ,
				`name` VARCHAR(50) NOT NULL ,
				`title` VARCHAR(100) NOT NULL ,
				`rules` VARCHAR(5120) NOT NULL ,
				PRIMARY KEY (`id`) ,
				UNIQUE INDEX `idx_asset_name` (`name` ASC) ,
				INDEX `idx_lft_rgt` (`lft` ASC, `rgt` ASC) ,
				INDEX `idx_parent_id` (`parent_id` ASC) )
			ENGINE = InnoDB
			DEFAULT CHARACTER SET = utf8
			COLLATE = utf8_general_ci;";

			$db->setQuery($query);
			$db->query();

			// Insert some default values
			$query = "INSERT INTO `#__assets` (`id`, `parent_id`, `lft`, `rgt`, `level`, `name`, `title`, `rules`)
			VALUES
				(1,0,0,0,0, 'root.1', 'Root Asset', '{\"core.login.site\":{\"1\":1,\"6\":1,\"2\":1},\"core.login.admin\":{\"6\":1},\"core.admin\":{\"8\":1},\"core.manage\":{\"7\":1},\"core.create\":{\"6\":1,\"3\":1},\"core.delete\":{\"6\":1},\"core.edit\":{\"6\":1,\"4\":1},\"core.edit.state\":{\"6\":1,\"5\":1},\"core.edit.own\":{\"6\":1,\"3\":1}}'),
{'fraction_non_alphanumeric': 0.22414841849148417, 'fraction_numerical': 0.04531630170316302, 'mean_word_length': 3.632394366197183, 'pattern_counts': {'":': 47, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '965577', 'n_tokens_mistral': 1446, 'n_tokens_neox': 1232, 'n_words': 302}