From d391a2cbf0cd59ceace2cabd042330e9e1dea4ee Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 19 Jan 2025 08:33:05 +0200 Subject: fix: Rename Webpage to Webpages and remove unique path constraint --- migrations/00-initial.sql | 4 ++-- models/database.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/migrations/00-initial.sql b/migrations/00-initial.sql index 8ac5ac0..f50d9d2 100644 --- a/migrations/00-initial.sql +++ b/migrations/00-initial.sql @@ -17,9 +17,9 @@ CREATE TABLE IF NOT EXISTS Cookies ( FOREIGN KEY (UID) REFERENCES Users(UID) ); -CREATE TABLE IF NOT EXISTS Webpage ( +CREATE TABLE IF NOT EXISTS Webpages ( WID INT NOT NULL AUTO_INCREMENT, - Path VARCHAR(512) NOT NULL UNIQUE, + Path VARCHAR(512) NOT NULL, URL VARCHAR(512) NOT NULL, Date DATETIME NOT NULL, Visits INT NOT NULL, diff --git a/models/database.php b/models/database.php index f1531f5..5f94ec3 100644 --- a/models/database.php +++ b/models/database.php @@ -38,7 +38,7 @@ class Webpage extends Table { static function create(string $Path, string $URL, int $RequesterUID) : int { return Table::_create( - 'Webpage', + 'Webpages', '(Path, URL, Date, Visits, RequesterUID)', "(\"$Path\", \"$URL\", NOW(), 0, \"$RequesterUID\")" ); @@ -46,7 +46,7 @@ class Webpage extends Table { static function fromDB(string $URL) : Webpage { return Table::_fromDB( - "SELECT * FROM Webpage WHERE URL = \"$URL\"", + "SELECT * FROM Webpages WHERE URL = \"$URL\"", "Database\Webpage" ); } -- cgit v1.2.3