default empty userclass for blocks

This commit is contained in:
Shish 2023-06-26 14:46:11 +01:00
parent d1da3504f1
commit ef52d572f1

View file

@ -20,13 +20,13 @@ class Blocks extends Extension
area VARCHAR(16) NOT NULL, area VARCHAR(16) NOT NULL,
priority INTEGER NOT NULL, priority INTEGER NOT NULL,
content TEXT NOT NULL, content TEXT NOT NULL,
userclass TEXT NOT NULL userclass TEXT NOT NULL DEFAULT ''
"); ");
$database->execute("CREATE INDEX blocks_pages_idx ON blocks(pages)", []); $database->execute("CREATE INDEX blocks_pages_idx ON blocks(pages)", []);
$this->set_version("ext_blocks_version", 2); $this->set_version("ext_blocks_version", 2);
} }
if ($this->get_version("ext_blocks_version") < 2) { if ($this->get_version("ext_blocks_version") < 2) {
$database->execute("ALTER TABLE blocks ADD COLUMN userclass TEXT NOT NULL"); $database->execute("ALTER TABLE blocks ADD COLUMN userclass TEXT NOT NULL DEFAULT ''");
$this->set_version("ext_blocks_version", 2); $this->set_version("ext_blocks_version", 2);
} }
} }