Delete unused le_enabled in "sites" table

This commit is contained in:
Miraty 2022-09-14 18:34:44 +02:00
parent 5885f7a416
commit 3571c456fd
3 changed files with 15 additions and 2 deletions

View file

@ -0,0 +1,15 @@
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "sites-new" (
"id" INTEGER NOT NULL UNIQUE,
"username" TEXT NOT NULL,
"site_dir" TEXT NOT NULL,
"domain" TEXT NOT NULL UNIQUE,
"domain_type" TEXT NOT NULL,
"protocol" TEXT NOT NULL,
"creation_date" INTEGER NOT NULL,
PRIMARY KEY("id" AUTOINCREMENT)
);
INSERT INTO "sites-new" SELECT "id","username","site_dir","domain","domain_type","protocol","creation_date" FROM "sites";
DROP TABLE "sites";
ALTER TABLE "sites-new" RENAME TO "sites";
COMMIT;

View file

@ -27,7 +27,6 @@ CREATE TABLE IF NOT EXISTS "sites" (
"domain_type" TEXT NOT NULL,
"protocol" TEXT NOT NULL,
"creation_date" INTEGER NOT NULL,
"le_enabled" INTEGER,
PRIMARY KEY("id" AUTOINCREMENT)
);
COMMIT;

View file

@ -29,7 +29,6 @@ function addSite($username, $siteDir, $domain, $domainType, $protocol) {
'domain_type' => $domainType,
'protocol' => $protocol,
'creation_date' => date("Y-m-d H:i:s"),
'le_enabled' => (($domainType === "dns" AND $protocol === "http") ? 0 : NULL),
]);
}