<commit_before><?php
class SpotStruct_mysql extends SpotStruct_abs {

	function createDatabase() {
		# spots
		if (!$this->tableExists('spots')) {
			$this->_dbcon->rawExec("CREATE TABLE spots(id INTEGER PRIMARY KEY AUTO_INCREMENT, 
										messageid varchar(128) CHARACTER SET ascii NOT NULL,
										category INTEGER, 
										subcat INTEGER,
										poster VARCHAR(128) NOT NULL,
										groupname VARCHAR(128),
										subcata VARCHAR(64),
										subcatb VARCHAR(64),
										subcatc VARCHAR(64),
										subcatd VARCHAR(64),
										subcatz VARCHAR(64),
										title VARCHAR(128) NOT NULL,
										tag VARCHAR(128),
										stamp INTEGER(10) UNSIGNED,
										reversestamp INTEGER DEFAULT 0,
										filesize BIGINT UNSIGNED NOT NULL DEFAULT 0,
										moderated BOOLEAN,
										commentcount INTEGER DEFAULT 0,
										spotrating INTEGER DEFAULT 0) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
			$this->_dbcon->rawExec("CREATE UNIQUE INDEX idx_spots_1 ON spots(messageid);");
			$this->_dbcon->rawExec("CREATE INDEX idx_spots_2 ON spots(stamp);");
			$this->_dbcon->rawExec("CREATE INDEX idx_spots_3 ON spots(reversestamp);");
			$this->_dbcon->rawExec("CREATE INDEX idx_spots_4 ON spots(category, subcata, subcatb, subcatc, subcatd, subcatz DESC);");
		} # if

		# spotsfull
		if (!$this->tableExists('spotsfull')) {
			$this->_dbcon->rawExec("CREATE TABLE spotsfull(id INTEGER PRIMARY KEY AUTO_INCREMENT, 
										messageid varchar(128) CHARACTER SET ascii NOT NULL,
										userid varchar(32),
										verified BOOLEAN,
										usersignature VARCHAR(128),
										userkey VARCHAR(200),
										xmlsignature VARCHAR(128),
										fullxml TEXT,
										filesize BIGINT UNSIGNED NOT NULL DEFAULT 0) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
			$this->_dbcon->rawExec("CREATE UNIQUE INDEX idx_spotsfull_1 ON spotsfull(messageid);");
		} # if

		# spottexts
		if (!$this->tableExists('spottexts')) {
			$this->_dbcon->rawExec("CREATE TABLE spottexts(messageid varchar(128) CHARACTER SET ascii NOT NULL,
										userid varchar(128),
										userid varchar(128),
										userid varchar(128)) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
			$this->_dbcon->rawExec("CREATE UNIQUE INDEX idx_spottexts_1 ON spottexts(messageid);");
			$this->_dbcon->rawExec("CREATE FULLTEXT INDEX idx_spottexts_2 ON spottexts(poster);");
			$this->_dbcon->rawExec("CREATE FULLTEXT INDEX idx_spottexts_3 ON spottexts(title);");
			$this->_dbcon->rawExec("CREATE FULLTEXT INDEX idx_spottexts_4 ON spottexts(tag);");
		} # if

		# NNTP table
		if (!$this->tableExists('nntp')) {
			$this->_dbcon->rawExec("CREATE TABLE nntp(server varchar(128) PRIMARY KEY,
										   maxarticleid INTEGER UNIQUE,
										   nowrunning INTEGER DEFAULT 0,
										   lastrun INTEGER DEFAULT 0) ENGINE = InnoDB CHARSET=utf8 COLLATE=utf8_unicode_ci;");
		} # if <commit_msg>Met verschillende veldnamen werkt het beter<commit_after><?php
class SpotStruct_mysql extends SpotStruct_abs {

	function createDatabase() {
		# spots
		if (!$this->tableExists('spots')) {
			$this->_dbcon->rawExec("CREATE TABLE spots(id INTEGER PRIMARY KEY AUTO_INCREMENT, 
										messageid varchar(128) CHARACTER SET ascii NOT NULL,
										category INTEGER, 
										subcat INTEGER,
										poster VARCHAR(128) NOT NULL,
										groupname VARCHAR(128),
										subcata VARCHAR(64),
										subcatb VARCHAR(64),
										subcatc VARCHAR(64),
										subcatd VARCHAR(64),
										subcatz VARCHAR(64),
										title VARCHAR(128) NOT NULL,
										tag VARCHAR(128),
										stamp INTEGER(10) UNSIGNED,
										reversestamp INTEGER DEFAULT 0,
										filesize BIGINT UNSIGNED NOT NULL DEFAULT 0,
										moderated BOOLEAN,
										commentcount INTEGER DEFAULT 0,
										spotrating INTEGER DEFAULT 0) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
			$this->_dbcon->rawExec("CREATE UNIQUE INDEX idx_spots_1 ON spots(messageid);");
			$this->_dbcon->rawExec("CREATE INDEX idx_spots_2 ON spots(stamp);");
			$this->_dbcon->rawExec("CREATE INDEX idx_spots_3 ON spots(reversestamp);");
			$this->_dbcon->rawExec("CREATE INDEX idx_spots_4 ON spots(category, subcata, subcatb, subcatc, subcatd, subcatz DESC);");
		} # if

		# spotsfull
		if (!$this->tableExists('spotsfull')) {
			$this->_dbcon->rawExec("CREATE TABLE spotsfull(id INTEGER PRIMARY KEY AUTO_INCREMENT, 
										messageid varchar(128) CHARACTER SET ascii NOT NULL,
										userid varchar(32),
										verified BOOLEAN,
										usersignature VARCHAR(128),
										userkey VARCHAR(200),
										xmlsignature VARCHAR(128),
										fullxml TEXT,
										filesize BIGINT UNSIGNED NOT NULL DEFAULT 0) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
			$this->_dbcon->rawExec("CREATE UNIQUE INDEX idx_spotsfull_1 ON spotsfull(messageid);");
		} # if

		# spottexts
		if (!$this->tableExists('spottexts')) {
			$this->_dbcon->rawExec("CREATE TABLE spottexts(messageid varchar(128) CHARACTER SET ascii NOT NULL,
										poster varchar(128),
										title varchar(128),
										tag varchar(128)) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
			$this->_dbcon->rawExec("CREATE UNIQUE INDEX idx_spottexts_1 ON spottexts(messageid);");
			$this->_dbcon->rawExec("CREATE FULLTEXT INDEX idx_spottexts_2 ON spottexts(poster);");
			$this->_dbcon->rawExec("CREATE FULLTEXT INDEX idx_spottexts_3 ON spottexts(title);");
			$this->_dbcon->rawExec("CREATE FULLTEXT INDEX idx_spottexts_4 ON spottexts(tag);");
		} # if

		# NNTP table
		if (!$this->tableExists('nntp')) {
			$this->_dbcon->rawExec("CREATE TABLE nntp(server varchar(128) PRIMARY KEY,
										   maxarticleid INTEGER UNIQUE,
										   nowrunning INTEGER DEFAULT 0,
										   lastrun INTEGER DEFAULT 0) ENGINE = InnoDB CHARSET=utf8 COLLATE=utf8_unicode_ci;");
		} # if 
{'fraction_non_alphanumeric': 0.10920698924731183, 'fraction_numerical': 0.026881720430107527, 'mean_word_length': 3.3516081871345027, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '7536919', 'n_tokens_mistral': 2756, 'n_tokens_neox': 1871, 'n_words': 463}