Skip to content
Snippets Groups Projects
Commit c2908ebf authored by Jared Hancock's avatar Jared Hancock
Browse files

Drop `content_id` and `lang` from %content

parent e3c0b8e3
No related branches found
No related tags found
No related merge requests found
...@@ -275,13 +275,9 @@ class Page extends VerySimpleModel { ...@@ -275,13 +275,9 @@ class Page extends VerySimpleModel {
$this->isactive = (bool) $vars['isactive']; $this->isactive = (bool) $vars['isactive'];
$this->notes = Format::sanitize($vars['notes']); $this->notes = Format::sanitize($vars['notes']);
if (!isset($this->id)) { $isnew = !isset($this->id);
if ($this->save()) { $rv = $this->save();
$this->content_id = $this->id; if (!$isnew)
$rv = $this->save();
}
}
elseif ($this->save())
$rv = $this->saveTranslations($vars, $errors); $rv = $this->saveTranslations($vars, $errors);
// Attach inline attachments from the editor // Attach inline attachments from the editor
......
...@@ -9,3 +9,20 @@ ALTER TABLE `%TABLE_PREFIX%form_field` ...@@ -9,3 +9,20 @@ ALTER TABLE `%TABLE_PREFIX%form_field`
DROP `private`, DROP `private`,
DROP `required`, DROP `required`,
DROP `edit_mask`; DROP `edit_mask`;
ALTER TABLE `%TABLE_PREFIX%content`
DROP `lang`;
-- DROP IF EXISTS `%content.content_id`
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = '%TABLE_PREFIX%content'
AND table_schema = DATABASE()
AND column_name = 'content_id'
) > 0,
"SELECT 1",
"ALTER TABLE `%TABLE_PREFIX%content` DROP `content_id`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;
/**
* @signature 959aca6ed189cd918d227a3ea8a135a3
* @version v1.9.6
* @title Retire `private`, `required`, and `edit_mask` for fields
*
*/
-- Finished with patch
UPDATE `%TABLE_PREFIX%config`
SET `value` = '959aca6ed189cd918d227a3ea8a135a3'
WHERE `key` = 'schema_signature' AND `namespace` = 'core';
...@@ -69,11 +69,7 @@ ALTER TABLE `%TABLE_PREFIX%help_topic` ...@@ -69,11 +69,7 @@ ALTER TABLE `%TABLE_PREFIX%help_topic`
-- Add `content_id` to the content table to allow for translations -- Add `content_id` to the content table to allow for translations
RENAME TABLE `%TABLE_PREFIX%page` TO `%TABLE_PREFIX%content`; RENAME TABLE `%TABLE_PREFIX%page` TO `%TABLE_PREFIX%content`;
ALTER TABLE `%TABLE_PREFIX%content` ALTER TABLE `%TABLE_PREFIX%content`
CHANGE `type` `type` varchar(32) NOT NULL default 'other', CHANGE `type` `type` varchar(32) NOT NULL default 'other';
ADD `content_id` int(10) unsigned NOT NULL default 0 AFTER `id`;
UPDATE `%TABLE_PREFIX%content`
SET `content_id` = `id`;
DROP TABLE IF EXISTS `%TABLE_PREFIX%user_account`; DROP TABLE IF EXISTS `%TABLE_PREFIX%user_account`;
CREATE TABLE `%TABLE_PREFIX%user_account` ( CREATE TABLE `%TABLE_PREFIX%user_account` (
......
...@@ -799,12 +799,10 @@ CREATE TABLE `%TABLE_PREFIX%task` ( ...@@ -799,12 +799,10 @@ CREATE TABLE `%TABLE_PREFIX%task` (
-- pages -- pages
CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%content` ( CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%content` (
`id` int(10) unsigned NOT NULL auto_increment, `id` int(10) unsigned NOT NULL auto_increment,
`content_id` int(10) unsigned NOT NULL default '0',
`isactive` tinyint(1) unsigned NOT NULL default '0', `isactive` tinyint(1) unsigned NOT NULL default '0',
`type` varchar(32) NOT NULL default 'other', `type` varchar(32) NOT NULL default 'other',
`name` varchar(255) NOT NULL, `name` varchar(255) NOT NULL,
`body` text NOT NULL, `body` text NOT NULL,
`lang` varchar(16) NOT NULL default 'en_US',
`notes` text, `notes` text,
`created` datetime NOT NULL, `created` datetime NOT NULL,
`updated` datetime NOT NULL, `updated` datetime NOT NULL,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment