From 2eb7fef0277171fce533e609ca40b59c284c9232 Mon Sep 17 00:00:00 2001 From: Mike Colagrosso Date: Sun, 13 Oct 2024 21:12:03 -0600 Subject: [PATCH] Remove primary key GitCommitId The table already has a Created column, and that's the column we use to sort on. --- config/sql/se/GitCommits.sql | 2 -- lib/GitCommit.php | 3 --- 2 files changed, 5 deletions(-) diff --git a/config/sql/se/GitCommits.sql b/config/sql/se/GitCommits.sql index ee630ded..5b1901d5 100644 --- a/config/sql/se/GitCommits.sql +++ b/config/sql/se/GitCommits.sql @@ -1,9 +1,7 @@ CREATE TABLE `GitCommits` ( - `GitCommitId` int(10) unsigned NOT NULL AUTO_INCREMENT, `EbookId` int(10) unsigned NOT NULL, `Created` datetime NOT NULL, `Message` text NOT NULL, `Hash` char(40) NOT NULL, - PRIMARY KEY (`GitCommitId`), KEY `index1` (`EbookId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/lib/GitCommit.php b/lib/GitCommit.php index a2bc22d3..381022e8 100644 --- a/lib/GitCommit.php +++ b/lib/GitCommit.php @@ -2,7 +2,6 @@ use Safe\DateTimeImmutable; class GitCommit{ - public ?int $GitCommitId = null; public ?int $EbookId = null; public DateTimeImmutable $Created; public string $Message; @@ -85,7 +84,5 @@ class GitCommit{ ?, ?) ', [$this->EbookId, $this->Created, $this->Message, $this->Hash]); - - $this->GitCommitId = Db::GetLastInsertedId(); } }