<commit_before>DROP DATABASE IF EXISTS `lead`;
CREATE DATABASE IF NOT EXISTS `lead` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;

USE `lead`;

SET default_storage_engine=INNODB;

CREATE TABLE IF NOT EXISTS `hash`(
    `id` INT PRIMARY KEY,
    `k` VARCHAR(16) UNIQUE KEY
);

CREATE TABLE IF NOT EXISTS `user`(
    `id` SERIAL PRIMARY KEY,
    `un` VARCHAR(16) NOT NULL,
    `sess` VARCHAR(32) NOT NULL,
    `status` TINYINT UNSIGNED DEFAULT 1,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`un`),
    KEY (`sess`),
    KEY (`updatedAt`),
    KEY (`createdBy`)
);

CREATE TABLE IF NOT EXISTS `userMap`(
    `id` SERIAL PRIMARY KEY,
    `userId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v` TEXT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`userId`, `k`)
);

CREATE TABLE IF NOT EXISTS `userMapInt`(
    `id` SERIAL PRIMARY KEY,
    `userId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v` INT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`userId`, `k`)
);

CREATE TABLE IF NOT EXISTS `userList`(
    `id` SERIAL PRIMARY KEY,
    `userId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v` TEXT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    KEY (`userId`, `k`)
);

CREATE TABLE IF NOT EXISTS `device`(
    `id` SERIAL PRIMARY KEY,
    `userId` BIGINT UNSIGNED NOT NULL,
    `status` TINYINT UNSIGNED DEFAULT 1,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    KEY (`userId`),
    KEY (`updatedAt`),
    KEY (`createdBy`)
);

CREATE TABLE IF NOT EXISTS `deviceMap`(
    `id` SERIAL PRIMARY KEY,
    `deviceId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v` TEXT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`deviceId`, `k`)
);

CREATE TABLE IF NOT EXISTS `deviceMapInt`(
    `id` SERIAL PRIMARY KEY,
    `deviceId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v` INT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`deviceId`, `k`)
);

CREATE TABLE IF NOT EXISTS `lock`(
    `id` SERIAL PRIMARY KEY,
    `placeId` BIGINT UNSIGNED NOT NULL,
    `name` VARCHAR(32),
    `status` TINYINT UNSIGNED DEFAULT 1,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    KEY (`placeId`,`name`),
    KEY (`updatedAt`),
    KEY (`createdBy`)
);

CREATE TABLE IF NOT EXISTS `lockMapInt`(
    `id` SERIAL PRIMARY KEY,
    `placeId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v` TEXT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`placeId`, `k`)
);<commit_msg>combined text and int tables<commit_after>DROP DATABASE IF EXISTS `lead`;
CREATE DATABASE IF NOT EXISTS `lead` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;

USE `lead`;

SET default_storage_engine=INNODB;

CREATE TABLE IF NOT EXISTS `hash`(
    `id` INT PRIMARY KEY,
    `k` VARCHAR(16) UNIQUE KEY
);

CREATE TABLE IF NOT EXISTS `user`(
    `id` SERIAL PRIMARY KEY,
    `un` VARCHAR(16) NOT NULL,
    `sess` VARCHAR(32) NOT NULL,
    `status` TINYINT UNSIGNED DEFAULT 1,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`un`),
    KEY (`sess`),
    KEY (`updatedAt`),
    KEY (`createdBy`)
);

CREATE TABLE IF NOT EXISTS `userMap`(
    `id` SERIAL PRIMARY KEY,
    `userId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v1` TEXT,
    `v2` INT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`userId`, `k`)
);

CREATE TABLE IF NOT EXISTS `userList`(
    `id` SERIAL PRIMARY KEY,
    `userId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v1` TEXT,
    `v2` INT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    KEY (`userId`, `k`)
);

CREATE TABLE IF NOT EXISTS `device`(
    `id` SERIAL PRIMARY KEY,
    `userId` BIGINT UNSIGNED NOT NULL,
    `status` TINYINT UNSIGNED DEFAULT 1,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    KEY (`userId`),
    KEY (`updatedAt`),
    KEY (`createdBy`)
);

CREATE TABLE IF NOT EXISTS `deviceMap`(
    `id` SERIAL PRIMARY KEY,
    `deviceId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v1` TEXT,
    `v2` INT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`deviceId`, `k`)
);

CREATE TABLE IF NOT EXISTS `lock`(
    `id` SERIAL PRIMARY KEY,
    `placeId` BIGINT UNSIGNED NOT NULL,
    `name` VARCHAR(32),
    `status` TINYINT UNSIGNED DEFAULT 1,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    KEY (`placeId`,`name`),
    KEY (`updatedAt`),
    KEY (`createdBy`)
);

CREATE TABLE IF NOT EXISTS `lockMap`(
    `id` SERIAL PRIMARY KEY,
    `placeId` BIGINT UNSIGNED NOT NULL,
    `k` INT NOT NULL,
    `v1` TEXT,
    `v2` INT,
    `updatedBy` BIGINT UNSIGNED,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `createdBy` BIGINT UNSIGNED NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY (`placeId`, `k`)
);
{'fraction_non_alphanumeric': 0.09734513274336283, 'fraction_numerical': 0.004701327433628319, 'mean_word_length': 3.812375249500998, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2104361', 'n_tokens_mistral': 2825, 'n_tokens_neox': 2554, 'n_words': 808}