<commit_before><?php
/**
* $Id: mysql.update.sql.php,v 1.6 2006-07-12 08:19:03 matteo Exp $
*
* CREATE TABLE instruction for MySQL database - UPDATE STAGE from 1.x to 2.0.0
*
* @author       <NAME> <<EMAIL>>
* @author       <NAME> <<EMAIL>>
* @author       <NAME> <<EMAIL>>
* @author       <NAME> <<EMAIL>>
* @since        2006-07-03
* @copyright    (c) 2001-2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

//
// TABLES
//

//faqconfig
$query[] = "CREATE TABLE ".SQLPREFIX."faqconfig (
config_name varchar(255) NOT NULL default '',
config_value varchar(255) NOT NULL default '',
PRIMARY KEY (config_name))";

//faqcategory_group
$query[] = "CREATE TABLE ".SQLPREFIX."faqcategory_group (
category_id INT(11) NOT NULL,
group_id INT(11) NOT NULL,
PRIMARY KEY (category_id, group_id))";

//faqcategory_user
$query[] = "CREATE TABLE ".SQLPREFIX."faqcategory_user (
category_id INT(11) NOT NULL,
user_id INT(11) NOT NULL,
PRIMARY KEY (category_id, user_id))";

//faqdata_group
$query[] = "CREATE TABLE ".SQLPREFIX."faqdata_group (
record_id INT(11) NOT NULL,
group_id INT(11) NOT NULL,
PRIMARY KEY (record_id, group_id))";

//faqdata_user
$query[] = "CREATE TABLE ".SQLPREFIX."faqdata_user (
record_id INT(11) NOT NULL,
user_id INT(11) NOT NULL,
PRIMARY KEY (record_id, user_id))";

//faqglossary
$query[] = "CREATE TABLE ".SQLPREFIX."faqglossary (
id INT(11) NOT NULL ,
lang VARCHAR(2) NOT NULL ,
item VARCHAR(255) NOT NULL ,
definition TEXT NOT NULL,
PRIMARY KEY (id, lang))";

//faqgroup
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faqgroup (
group_id INT(11) UNSIGNED NOT NULL,
name VARCHAR(25) NULL,
description TEXT NULL,
auto_join INT(1) UNSIGNED NULL,
PRIMARY KEY(group_id),
UNIQUE INDEX name(name)
)";

//faqgroup_right
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faqgroup_right (
group_id INT(11) UNSIGNED NOT NULL,
right_id INT(11) UNSIGNED NOT NULL,
PRIMARY KEY(group_id, right_id)
)";

//faqlinkverifyrules
$query[] = "CREATE TABLE ".SQLPREFIX."faqlinkverifyrules (
id int(11) NOT NULL default '0',
type varchar(6) NOT NULL default '',
url varchar(255) NOT NULL default '',
reason varchar(255) NOT NULL default '',
enabled enum('y','n') NOT NULL default 'y',
locked enum('y','n') NOT NULL default 'n',
owner varchar(255) NOT NULL default '',
dtInsertDate varchar(15) NOT NULL default '',
dtUpdateDate varchar(15) NOT NULL default '',
PRIMARY KEY (id)
)";

//faqright
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faqright (
right_id INT(11) UNSIGNED NOT NULL,
name VARCHAR(50) NULL,
description TEXT NULL,
for_users INT(1) UNSIGNED NULL DEFAULT 1,
for_groups INT(1) UNSIGNED NULL DEFAULT 1,
PRIMARY KEY(right_id)
)";

//faquser
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquser (
user_id INT(11) UNSIGNED NOT NULL,
login VARCHAR(25) NOT NULL,
session_id VARCHAR(150) NULL,
session_timestamp INT(11) UNSIGNED NOT NULL,
ip VARCHAR(15) NULL,
account_status VARCHAR(50) NULL,
last_login TIMESTAMP(14) NULL,
auth_source VARCHAR(100) NULL,
member_since TIMESTAMP(14) NULL,
PRIMARY KEY(user_id),
UNIQUE INDEX session(session_id),
UNIQUE INDEX login(login)
)";

//faquserdata
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquserdata (
user_id INT(11) UNSIGNED NOT NULL,
last_modified TIMESTAMP(14) NULL,
display_name VARCHAR(50) NULL,
email VARCHAR(100) NULL
)";

//faquserlogin
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquserlogin (
login VARCHAR(25) NOT NULL,
pass VARCHAR(150) NULL,
PRIMARY KEY(login)
)";

//faquser_group
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquser_group (
user_id INT(11) UNSIGNED NOT NULL,
group_id INT(11) UNSIGNED NOT NULL,
PRIMARY KEY(user_id, group_id)
)";

//faquser_right
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquser_right (
user_id INT(11) UNSIGNED NOT NULL,
right_id INT(11) UNSIGNED NOT NULL,
PRIMARY KEY(user_id, right_id)
)";


//
// DATA
//

$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('adminmail', '<EMAIL>')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('attmax', '100000')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('bannedIP', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('detection', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('disatt', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('enableadminlog', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('enablevisibility', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('ipcheck', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('language', 'language_en.php')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('ldap_support', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('metaDescription', 'phpMyFAQ should be the answer for all questions in life')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('metaKeywords', '')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('metaPublisher', '<NAME>')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('mod_rewrite', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('msgContactOwnText', '')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('numNewsArticles', '3')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('numRecordsPage', '10')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('parse_php', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('permlevel', 'basic')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('referenceURL', '')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('send2friendText', '')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('spamCheckBannedWords', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('spamEnableCatpchaCode', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('spamEnableSafeEmail', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('title', 'phpMyFAQ Codename \"Prometheus\"')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('tracking', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('URLValidateInterval', '86400')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('version', '2.0.0')";

$query[] = "INSERT INTO ".SQLPREFIX."faqright VALUES (1, 'adduser', 'Right to add user accounts', 1, 1)";<commit_msg>Fix: Typo, see also config.sql.php, v1.2<commit_after><?php
/**
* $Id: mysql.update.sql.php,v 1.7 2006-07-13 19:14:45 matteo Exp $
*
* CREATE TABLE instruction for MySQL database - UPDATE STAGE from 1.x to 2.0.0
*
* @author       <NAME> <<EMAIL>>
* @author       <NAME> <<EMAIL>>
* @author       <NAME> <<EMAIL>>
* @author       <NAME> <<EMAIL>>
* @since        2006-07-03
* @copyright    (c) 2001-2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

//
// TABLES
//

//faqconfig
$query[] = "CREATE TABLE ".SQLPREFIX."faqconfig (
config_name varchar(255) NOT NULL default '',
config_value varchar(255) NOT NULL default '',
PRIMARY KEY (config_name))";

//faqcategory_group
$query[] = "CREATE TABLE ".SQLPREFIX."faqcategory_group (
category_id INT(11) NOT NULL,
group_id INT(11) NOT NULL,
PRIMARY KEY (category_id, group_id))";

//faqcategory_user
$query[] = "CREATE TABLE ".SQLPREFIX."faqcategory_user (
category_id INT(11) NOT NULL,
user_id INT(11) NOT NULL,
PRIMARY KEY (category_id, user_id))";

//faqdata_group
$query[] = "CREATE TABLE ".SQLPREFIX."faqdata_group (
record_id INT(11) NOT NULL,
group_id INT(11) NOT NULL,
PRIMARY KEY (record_id, group_id))";

//faqdata_user
$query[] = "CREATE TABLE ".SQLPREFIX."faqdata_user (
record_id INT(11) NOT NULL,
user_id INT(11) NOT NULL,
PRIMARY KEY (record_id, user_id))";

//faqglossary
$query[] = "CREATE TABLE ".SQLPREFIX."faqglossary (
id INT(11) NOT NULL ,
lang VARCHAR(2) NOT NULL ,
item VARCHAR(255) NOT NULL ,
definition TEXT NOT NULL,
PRIMARY KEY (id, lang))";

//faqgroup
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faqgroup (
group_id INT(11) UNSIGNED NOT NULL,
name VARCHAR(25) NULL,
description TEXT NULL,
auto_join INT(1) UNSIGNED NULL,
PRIMARY KEY(group_id),
UNIQUE INDEX name(name)
)";

//faqgroup_right
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faqgroup_right (
group_id INT(11) UNSIGNED NOT NULL,
right_id INT(11) UNSIGNED NOT NULL,
PRIMARY KEY(group_id, right_id)
)";

//faqlinkverifyrules
$query[] = "CREATE TABLE ".SQLPREFIX."faqlinkverifyrules (
id int(11) NOT NULL default '0',
type varchar(6) NOT NULL default '',
url varchar(255) NOT NULL default '',
reason varchar(255) NOT NULL default '',
enabled enum('y','n') NOT NULL default 'y',
locked enum('y','n') NOT NULL default 'n',
owner varchar(255) NOT NULL default '',
dtInsertDate varchar(15) NOT NULL default '',
dtUpdateDate varchar(15) NOT NULL default '',
PRIMARY KEY (id)
)";

//faqright
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faqright (
right_id INT(11) UNSIGNED NOT NULL,
name VARCHAR(50) NULL,
description TEXT NULL,
for_users INT(1) UNSIGNED NULL DEFAULT 1,
for_groups INT(1) UNSIGNED NULL DEFAULT 1,
PRIMARY KEY(right_id)
)";

//faquser
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquser (
user_id INT(11) UNSIGNED NOT NULL,
login VARCHAR(25) NOT NULL,
session_id VARCHAR(150) NULL,
session_timestamp INT(11) UNSIGNED NOT NULL,
ip VARCHAR(15) NULL,
account_status VARCHAR(50) NULL,
last_login TIMESTAMP(14) NULL,
auth_source VARCHAR(100) NULL,
member_since TIMESTAMP(14) NULL,
PRIMARY KEY(user_id),
UNIQUE INDEX session(session_id),
UNIQUE INDEX login(login)
)";

//faquserdata
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquserdata (
user_id INT(11) UNSIGNED NOT NULL,
last_modified TIMESTAMP(14) NULL,
display_name VARCHAR(50) NULL,
email VARCHAR(100) NULL
)";

//faquserlogin
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquserlogin (
login VARCHAR(25) NOT NULL,
pass VARCHAR(150) NULL,
PRIMARY KEY(login)
)";

//faquser_group
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquser_group (
user_id INT(11) UNSIGNED NOT NULL,
group_id INT(11) UNSIGNED NOT NULL,
PRIMARY KEY(user_id, group_id)
)";

//faquser_right
$query[] = "CREATE TABLE IF NOT EXISTS ".SQLPREFIX."faquser_right (
user_id INT(11) UNSIGNED NOT NULL,
right_id INT(11) UNSIGNED NOT NULL,
PRIMARY KEY(user_id, right_id)
)";


//
// DATA
//

$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('adminmail', '<EMAIL>')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('attmax', '100000')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('bannedIP', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('detection', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('disatt', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('enableadminlog', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('enablevisibility', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('ipcheck', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('language', 'language_en.php')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('ldap_support', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('metaDescription', 'phpMyFAQ should be the answer for all questions in life')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('metaKeywords', '')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('metaPublisher', '<NAME>')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('mod_rewrite', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('msgContactOwnText', '')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('numNewsArticles', '3')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('numRecordsPage', '10')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('parse_php', 'false')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('permLevel', 'basic')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('referenceURL', '')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('send2friendText', '')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('spamCheckBannedWords', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('spamEnableCatpchaCode', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('spamEnableSafeEmail', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('title', 'phpMyFAQ Codename \"Prometheus\"')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('tracking', 'true')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('URLValidateInterval', '86400')";
$query[] = "INSERT INTO ".SQLPREFIX."faqconfig VALUES ('version', '2.0.0')";

$query[] = "INSERT INTO ".SQLPREFIX."faqright VALUES (1, 'adduser', 'Right to add user accounts', 1, 1)";
{'fraction_non_alphanumeric': 0.1628026790314271, 'fraction_numerical': 0.0241407227496872, 'mean_word_length': 5.535834535834536, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2217161', 'n_tokens_mistral': 4945, 'n_tokens_neox': 4500, 'n_words': 1422}