<commit_before>-- CREATE USER dddsouthwest_user WITH PASSWORD '<PASSWORD>';
-- CREATE DATABASE dddsouthwest;
-- GRANT ALL PRIVILEGES ON DATABASE dddsouthwest TO dddsouthwest_user;

-- Run below against your new Postgres SQL database

CREATE TABLE Events
(
    Id SERIAL PRIMARY KEY,
    EventName VARCHAR(200) NOT NULL,
    EventFilename VARCHAR(200),
    EventDate TIMESTAMP NULL
);

CREATE UNIQUE INDEX Events_Filename_uindex ON Events (EventFilename);


CREATE TABLE Talks
(
    Id SERIAL NOT NULL CONSTRAINT talks_pkey PRIMARY KEY,
    TalkTitle VARCHAR(255) NOT NULL,
    TalkSummary VARCHAR NOT NULL,
    TalkBodyHtml VARCHAR NOT NULL,
    TalkBodyMarkdown VARCHAR NOT NULL,
    DateAdded TIMESTAMP NOT NULL,
    LastModified TIMESTAMP NOT NULL,
    SubmissionDate TIMESTAMP,
    UserId INTEGER NOT NULL,
    IsApproved BOOLEAN DEFAULT FALSE NOT NULL,
    IsSubmitted BOOLEAN DEFAULT FALSE NOT NULL,
    CONSTRAINT talks_users_id_fk REFERENCES Users
);


CREATE TABLE Users
(
    Id SERIAL PRIMARY KEY,
    GivenName VARCHAR(150) NULL,
    FamilyName VARCHAR(150) NULL,
    EmailAddress VARCHAR(255) NOT NULL,
    Password VARCHAR(255) NOT NULL,
    Salt VARCHAR(255) NOT NULL,
    IsBlocked BOOLEAN DEFAULT FALSE NOT NULL,
    IsActivated BOOLEAN DEFAULT FALSE NOT NULL,
    Roles JSON NULL,
    ReceiveNewsletter BOOLEAN DEFAULT FALSE NOT NULL,
    DateRegistered TIMESTAMP NOT NULL,
);<commit_msg>Make the SQL more like it works<commit_after>-- CREATE USER dddsouthwest_user WITH PASSWORD '<PASSWORD>';
-- CREATE DATABASE dddsouthwest;
-- GRANT ALL PRIVILEGES ON DATABASE dddsouthwest TO dddsouthwest_user;

-- Run below against your new Postgres SQL database

CREATE TABLE Events
(
    Id SERIAL PRIMARY KEY,
    EventName VARCHAR(200) NOT NULL,
    EventFilename VARCHAR(200),
    EventDate TIMESTAMP NULL
);

CREATE UNIQUE INDEX Events_Filename_uindex ON Events (EventFilename);


CREATE TABLE Talks
(
    Id SERIAL NOT NULL CONSTRAINT talks_pkey PRIMARY KEY,
    TalkTitle VARCHAR(255) NOT NULL,
    TalkSummary VARCHAR NOT NULL,
    TalkBodyHtml VARCHAR NOT NULL,
    TalkBodyMarkdown VARCHAR NOT NULL,
    DateAdded TIMESTAMP NOT NULL,
    LastModified TIMESTAMP NOT NULL,
    SubmissionDate TIMESTAMP,
    UserId INTEGER NOT NULL,
    IsApproved BOOLEAN DEFAULT FALSE NOT NULL,
    IsSubmitted BOOLEAN DEFAULT FALSE NOT NULL,
    CONSTRAINT talks_users_id_fk FOREIGN KEY(UserId) REFERENCES Users
);


CREATE TABLE Users
(
    Id SERIAL PRIMARY KEY,
    GivenName VARCHAR(150) NULL,
    FamilyName VARCHAR(150) NULL,
    EmailAddress VARCHAR(255) NOT NULL,
    Password VARCHAR(255) NOT NULL,
    Salt VARCHAR(255) NOT NULL,
    IsBlocked BOOLEAN DEFAULT FALSE NOT NULL,
    IsActivated BOOLEAN DEFAULT FALSE NOT NULL,
    Roles JSON NULL,
    ReceiveNewsletter BOOLEAN DEFAULT FALSE NOT NULL,
    DateRegistered TIMESTAMP NOT NULL
);
{'fraction_non_alphanumeric': 0.05019305019305019, 'fraction_numerical': 0.016848016848016848, 'mean_word_length': 3.888507718696398, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2024974', 'n_tokens_mistral': 937, 'n_tokens_neox': 849, 'n_words': 320}