<commit_before>package dbutil


const dbconversion = `
-- Properties Needed for golang template
-- DBVersion, string, the current DB version or "00000000" if none
-- DBType, string, sqlite3 or postgres
-- DroppingTables, boolean, should we drop old tables?


{{/* These variables need to be defined for all databases */}}


{{ if eq .DBType "sqlite3" }}
-- Turn on fkey support so we don't do shitty things without realizing it
PRAGMA foreign_keys = ON;
{{ end }}


-- {{.DBType}} specific template features
-- Primary Key Expression: {{.pkey_exp}}



{{if eq .DBVersion "00000000"}}

CREATE TABLE PhoneCarrier (
	    id {{.pkey_exp}},
	    name CHAR(100) UNIQUE NOT NULL,
	    emaildomain CHAR(50) UNIQUE NOT NULL);



CREATE TABLE IF NOT EXISTS Users (
    Id {{.pkey_exp}},
	Name VARCHAR UNIQUE NOT NULL,
	Email VARCHAR UNIQUE NOT NULL,
	Password VARCHAR NOT NULL,
	PasswordSalt VARCHAR NOT NULL,
	PasswordHashScheme VARCHAR NOT NULL,
	Admin BOOLEAN DEFAULT FALSE,<commit_msg>Fixed error caused by sql in Postgres<commit_after>package dbutil


const dbconversion = `
-- Properties Needed for golang template
-- DBVersion, string, the current DB version or "00000000" if none
-- DBType, string, sqlite3 or postgres
-- DroppingTables, boolean, should we drop old tables?


{{/* These variables need to be defined for all databases */}}


{{ if eq .DBType "sqlite3" }}
-- Turn on fkey support so we don't do shitty things without realizing it
PRAGMA foreign_keys = ON;
{{ end }}


-- {{.DBType}} specific template features
-- Primary Key Expression: {{.pkey_exp}}



{{if eq .DBVersion "00000000"}}

CREATE TABLE PhoneCarrier (
	    id {{.pkey_exp}},
	    name VARCHAR UNIQUE NOT NULL,
	    emaildomain VARCHAR UNIQUE NOT NULL);



CREATE TABLE IF NOT EXISTS Users (
    Id {{.pkey_exp}},
	Name VARCHAR UNIQUE NOT NULL,
	Email VARCHAR UNIQUE NOT NULL,
	Password VARCHAR NOT NULL,
	PasswordSalt VARCHAR NOT NULL,
	PasswordHashScheme VARCHAR NOT NULL,
	Admin BOOLEAN DEFAULT FALSE,
{'fraction_non_alphanumeric': 0.09398686205154118, 'fraction_numerical': 0.020717534108135423, 'mean_word_length': 3.8410757946210268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '3616679', 'n_tokens_mistral': 651, 'n_tokens_neox': 575, 'n_words': 249}