title

Update database release Tiny Marbles CMS 2.6

In case your are running already either a Tiny Marbles CMS release 2.5 or the CMS modul release 2.5 you have to update in both cases your existing database. Here you find the SQL commands as an example for the database MySQL:

Create table:

CREATE TABLE 'cms_comments' (
'id' bigint(20) NOT NULL AUTO_INCREMENT,
'answer' longtext,
'content' longtext,
'date' bigint(20),
'email' varchar(255) DEFAULT NULL,
'website' varchar(255) DEFAULT NULL,
'locale' varchar(255) DEFAULT NULL,
'name' varchar(255) DEFAULT NULL,
'newEntry' tinyint(4) NOT NULL,
'published' bit(1) DEFAULT NULL,
'signature' varchar(255) DEFAULT NULL,
'article_id' bigint(20) DEFAULT NULL,
'zone_id' bigint(20) DEFAULT NULL,
PRIMARY KEY ('id'),
KEY 'FKFD8DF02AD498E8FF' ('article_id'),
KEY 'FKFD8DF02ABD4ED661' ('zone_id'),
CONSTRAINT 'FKFD8DF02ABD4ED661' FOREIGN KEY ('zone_id') REFERENCES 'mum_zone' ('id'),
CONSTRAINT 'FKFD8DF02AD498E8FF' FOREIGN KEY ('article_id') REFERENCES 'cms_article' ('id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Update table:

ALTER TABLE cms_articlecategory ADD COLUMN isLink BIT(1) NULL AFTER action;
UPDATE cms_articlecategory SET isLink = FALSE;
ALTER TABLE mum_user ADD COLUMN email VARCHAR(255) NULL AFTER signature;
ALTER TABLE cms_article ADD COLUMN showImageDescription BIT(1) NULL AFTER isPublished;
UPDATE cms_article SET showImageDescription = FALSE;
ALTER TABLE cms_article ADD COLUMN closeComments BIT(1) NULL AFTER showImageDescription;
UPDATE cms_article SET closeComments = FALSE;
ALTER TABLE mum_zone ADD COLUMN defaultLocale VARCHAR(255) NULL AFTER systemId;
UPDATE mum_zone SET defaultLocale = 'none';
ALTER TABLE mum_zone ADD COLUMN defaultAdminLocale VARCHAR(255) NULL AFTER defaultLocale;
UPDATE mum_zone SET defaultAdminLocale = 'none';
UPDATE cms_articlecategory SET ACTION = 'news' WHERE layout = 'News';
UPDATE cms_articlecategory SET ACTION = 'html' WHERE layout = 'Html';
UPDATE cms_articlecategory SET ACTION = 'listnews' WHERE layout = 'ListNews';

Insert for each zone, using 'your_zone_id', step 1 - 5:

1) Create board_id: INSERT INTO mum_board (defaultSize, freemarkerTmpl, systemId, zone_id)
VALUES ('1', '/admin/article/comments/dashboard.ftl', 'recent_comments', 'your_zone_id');
2) Create authorization_id: INSERT INTO mum_board_permissions (use_or, board_id)
VALUES ('1', 'board_id');
3) INSERT INTO mum_board_authorization (mum_board_id, authorization_id, talos_category)
VALUES ('board_id', 'authorization_id', 'org.cws.cms.model.article.version.News');
4) INSERT INTO mum_board_single_permissions (Permissions_id, talos_permission)
VALUES ('authorization_id', 'org.cws.cms.model.article.version.News.list');
5) INSERT INTO mum_board_single_permissions (Permissions_id, talos_permission)
VALUES ('authorization_id', 'org.cws.cms.model.article.version.News.my');