mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
re-worked to use new BLOCK table
This commit is contained in:
parent
b7fa3b9006
commit
bbc2237ef7
25 changed files with 1080 additions and 903 deletions
|
@ -1,10 +1,31 @@
|
|||
/* community edition */
|
||||
ALTER TABLE page ADD COLUMN `preset` BOOL NOT NULL DEFAULT 0 AFTER `pagetype`;
|
||||
ALTER TABLE page ADD COLUMN `presetid` CHAR(16) NOT NULL DEFAULT '' COLLATE utf8_bin AFTER `preset`;
|
||||
DROP TABLE IF EXISTS `block`;
|
||||
|
||||
/* Note:
|
||||
Preset data is not required in pagemeta as a simple join to page will surface these fields.
|
||||
Version history table does not need these fields as they are populated once during page creation:
|
||||
-- you cannot mark an existing section as a preset
|
||||
-- a page is only marked as preset during it's creation (e.g. created from an existing preset)
|
||||
CREATE TABLE IF NOT EXISTS `block` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`refid` CHAR(16) NOT NULL COLLATE utf8_bin,
|
||||
`orgid` CHAR(16) NOT NULL COLLATE utf8_bin,
|
||||
`labelid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
|
||||
`userid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
|
||||
`contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg',
|
||||
`pagetype` CHAR(10) NOT NULL DEFAULT 'section',
|
||||
`title` NVARCHAR(2000) NOT NULL,
|
||||
`body` LONGTEXT,
|
||||
`excerpt` NVARCHAR(2000) NOT NULL,
|
||||
`used` INT UNSIGNED NOT NULL,
|
||||
`rawbody` LONGBLOB,
|
||||
`config` JSON,
|
||||
`externalsource` BOOL DEFAULT 0,
|
||||
`created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
`revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT pk_id PRIMARY KEY (id),
|
||||
INDEX `idx_block_refid` (`refid` ASC),
|
||||
INDEX `idx_block_labelid` (`labelid` ASC))
|
||||
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
|
||||
ENGINE = InnoDB;
|
||||
|
||||
ALTER TABLE page ADD COLUMN `blockid` CHAR(16) NOT NULL DEFAULT '' COLLATE utf8_bin AFTER `pagetype`;
|
||||
/* Note: version history table does not need blockid field as they are populated once during page creation:
|
||||
- you cannot mark an existing section as a preset
|
||||
- a page is only marked as preset during it's creation (e.g. created from an existing preset)
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue