<commit_before>
CREATE DATABASE DysproBackupManager;
USE DysproBackupManager;

CREATE TABLE Servers
(            ServerId INT AUTO_INCREMENT PRIMARY KEY
,            HostName VARCHAR(100) NOT NULL
,            UserName VARCHAR(100) NOT NULL
,            PathSSHKeyFile VARCHAR(500) NOT NULL
,            UNIQUE (HostName));

CREATE TABLE Schedules
(            ScheduleId INT AUTO_INCREMENT PRIMARY KEY
,            ServerId INT NOT NULL
,            PathLocalDropoff VARCHAR(500) NOT NULL
,            PathServerPickup VARCHAR(500) NOT NULL
,            ManageLocalBackups BIT NOT NULL DEFAULT 0
,            DeleteServerPickups BIT NOT NULL DEFAULT 0
,            FOREIGN KEY (ServerId) REFERENCES Servers(ServerId));

CREATE TABLE BackupLog
(            BackupLogId INT AUTO_INCREMENT PRIMARY KEY
,            ScheduleId INT NOT NULL
,            DateStart DATETIME NOT NULL
,            DateFinish DATETIME
,            FOREIGN KEY (ScheduleId) REFERENCES Schedules(ScheduleId));

CREATE TABLE BackupLogFiles
(            BackupLogFileId INT AUTO_INCREMENT PRIMARY KEY
,            BackupLogId INT NOT NULL
,            FileName VARCHAR(250) NOT NULL
,            FileSize BIGINT UNSIGNED NOT NULL
,            DateCreated DATETIME NOT NULL
,            DateDeleted DATETIME
,            FOREIGN KEY (BackupLogId) REFERENCES BackupLog(BackupLogId));

SHOW TABLES;<commit_msg>Changed database to cascade deletes<commit_after>
CREATE DATABASE DysproBackupManager;
USE DysproBackupManager;

CREATE TABLE Servers
(            ServerId INT AUTO_INCREMENT PRIMARY KEY
,            HostName VARCHAR(100) NOT NULL
,            UserName VARCHAR(100) NOT NULL
,            PathSSHKeyFile VARCHAR(500) NOT NULL
,            UNIQUE (HostName));

CREATE TABLE Schedules
(            ScheduleId INT AUTO_INCREMENT PRIMARY KEY
,            ServerId INT NOT NULL
,            PathLocalDropoff VARCHAR(500) NOT NULL
,            PathServerPickup VARCHAR(500) NOT NULL
,            ManageLocalBackups BIT NOT NULL DEFAULT 0
,            DeleteServerPickups BIT NOT NULL DEFAULT 0
,            FOREIGN KEY (ServerId) REFERENCES Servers(ServerId) ON DELETE CASCADE);

CREATE TABLE BackupLog
(            BackupLogId INT AUTO_INCREMENT PRIMARY KEY
,            ScheduleId INT NOT NULL
,            DateStart DATETIME NOT NULL
,            DateFinish DATETIME
,            FOREIGN KEY (ScheduleId) REFERENCES Schedules(ScheduleId) ON DELETE CASCADE);

CREATE TABLE BackupLogFiles
(            BackupLogFileId INT AUTO_INCREMENT PRIMARY KEY
,            BackupLogId INT NOT NULL
,            FileName VARCHAR(250) NOT NULL
,            FileSize BIGINT UNSIGNED NOT NULL
,            DateCreated DATETIME NOT NULL
,            DateDeleted DATETIME
,            FOREIGN KEY (BackupLogId) REFERENCES BackupLog(BackupLogId) ON DELETE CASCADE);

SHOW TABLES;
{'fraction_non_alphanumeric': 0.04516584333098095, 'fraction_numerical': 0.014114326040931546, 'mean_word_length': 2.366983372921615, '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': '6925552', 'n_tokens_mistral': 852, 'n_tokens_neox': 775, 'n_words': 256}