<commit_before>--
--  Tigase Jabber/XMPP Server
--  Copyright (C) 2004-2007 "<NAME>" <<EMAIL>>
--
--  This program is free software: you can redistribute it and/or modify
--  it under the terms of the GNU General Public License as published by
--  the Free Software Foundation, either version 3 of the License.
--
--  This program is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--  GNU General Public License for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with this program. Look for COPYING file in the top folder.
--  If not, see http://www.gnu.org/licenses/.
--
--  $Rev: $
--  Last modified by $Author: $
--  $Date: $
--

--  To load schema to MySQL database execute following commands:
--
--  mysqladmin -u root -pdbpass create tigase
--  mysql -u root -pdbpass tigase < database/mysql-schema-4.sql
--  echo "GRANT ALL ON tigase.* TO tigase_user@'%' \
--                  IDENTIFIED BY 'tigase_passwd'; \
--                  FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql
--  echo "GRANT ALL ON tigase.* TO tigase_user@'localhost' \
--                  IDENTIFIED BY 'tigase_passwd'; \
--                  FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql
--  echo "GRANT ALL ON tigase.* TO tigase_user \
--                  IDENTIFIED BY 'tigase_passwd'; \
--                  FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql

-- QUERY START:

create table if not exists tig_users (
			 uid bigint unsigned NOT NULL auto_increment,

			 -- Jabber User ID
			 user_id varchar(2049) NOT NULL,
			 -- UserID SHA1 hash to prevent duplicate user_ids
			 sha1_user_id char(128) NOT NULL,
			 -- User password encrypted or not
			 user_pw varchar(255) default NULL,
			 -- Time of the last user login
			 last_login timestamp DEFAULT CURRENT_TIMESTAMP,
			 -- Time of the last user logout
			 last_logout timestamp DEFAULT '1970-01-01 01:01:01',
			 -- User online status, if > 0 then user is online, the value
			 -- indicates the number of user connections.
			 -- It is incremented on each user login and decremented on each
			 -- user logout.
			 online_status int default 0,
			 -- Number of failed login attempts
			 failed_logins int default 0,
			 -- User status, whether the account is active or disabled
			 -- >0 - account active, 0 - account disabled
			 account_status int default 1,

			 primary key (uid),
			 unique key sha1_user_id (sha1_user_id),
			 key user_pw (user_pw),
			 key user_id (user_id(765)),
			 key last_login (last_login),
			 key last_logout (last_logout),
			 key account_status (account_status),
			 key online_status (online_status)
)
ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC;

-- QUERY END:

-- QUERY START:

create table if not exists tig_nodes (
       nid bigint unsigned NOT NULL auto_increment,
       parent_nid bigint unsigned,
       uid bigint unsigned NOT NULL,<commit_msg>Account creation timestamp added to the main user table.<commit_after>--
--  Tigase Jabber/XMPP Server
--  Copyright (C) 2004-2007 "<NAME>" <<EMAIL>>
--
--  This program is free software: you can redistribute it and/or modify
--  it under the terms of the GNU General Public License as published by
--  the Free Software Foundation, either version 3 of the License.
--
--  This program is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--  GNU General Public License for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with this program. Look for COPYING file in the top folder.
--  If not, see http://www.gnu.org/licenses/.
--
--  $Rev: $
--  Last modified by $Author: $
--  $Date: $
--

--  To load schema to MySQL database execute following commands:
--
--  mysqladmin -u root -pdbpass create tigase
--  mysql -u root -pdbpass tigase < database/mysql-schema-4.sql
--  echo "GRANT ALL ON tigase.* TO tigase_user@'%' \
--                  IDENTIFIED BY 'tig<PASSWORD>passwd'; \
--                  FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql
--  echo "GRANT ALL ON tigase.* TO tigase_user@'localhost' \
--                  IDENTIFIED BY '<PASSWORD>passwd'; \
--                  FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql
--  echo "GRANT ALL ON tigase.* TO tigase_user \
--                  IDENTIFIED BY '<PASSWORD>passwd'; \
--                  FLUSH PRIVILEGES;" | mysql -u root -pdbpass mysql

-- QUERY START:

create table if not exists tig_users (
			 uid bigint unsigned NOT NULL auto_increment,

			 -- Jabber User ID
			 user_id varchar(2049) NOT NULL,
			 -- UserID SHA1 hash to prevent duplicate user_ids
			 sha1_user_id char(128) NOT NULL,
			 -- User password encrypted or not
			 user_pw varchar(255) default NULL,
       -- Time the account has been created
       acc_create_time timestamp DEFAULT CURRENT_TIMESTAMP,
			 -- Time of the last user login
			 last_login timestamp DEFAULT CURRENT_TIMESTAMP,
			 -- Time of the last user logout
			 last_logout timestamp DEFAULT CURRENT_TIMESTAMP,
			 -- User online status, if > 0 then user is online, the value
			 -- indicates the number of user connections.
			 -- It is incremented on each user login and decremented on each
			 -- user logout.
			 online_status int default 0,
			 -- Number of failed login attempts
			 failed_logins int default 0,
			 -- User status, whether the account is active or disabled
			 -- >0 - account active, 0 - account disabled
			 account_status int default 1,

			 primary key (uid),
			 unique key sha1_user_id (sha1_user_id),
			 key user_pw (user_pw),
			 key user_id (user_id(765)),
			 key last_login (last_login),
			 key last_logout (last_logout),
			 key account_status (account_status),
			 key online_status (online_status)
)
ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC;

-- QUERY END:

-- QUERY START:

create table if not exists tig_nodes (
       nid bigint unsigned NOT NULL auto_increment,
       parent_nid bigint unsigned,
       uid bigint unsigned NOT NULL,
{'fraction_non_alphanumeric': 0.08575558053637386, 'fraction_numerical': 0.013168459932551791, 'mean_word_length': 2.6209302325581394, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 16, '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': '5654088', 'n_tokens_mistral': 2062, 'n_tokens_neox': 1780, 'n_words': 748}