Delete unused le_enabled in "sites" table
This commit is contained in:
parent
5885f7a416
commit
3571c456fd
3 changed files with 15 additions and 2 deletions
15
db/migrations/001-delete-le_enabled-column.sql
Normal file
15
db/migrations/001-delete-le_enabled-column.sql
Normal 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;
|
|
@ -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;
|
|
@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue