Commit decc2020 authored by Tino Goratsch's avatar Tino Goratsch

When deleting a category, the associated news or downloads won't be deleted anymore

# Conflicts:
#	CHANGELOG.md
#	installation/Installer/Modules/Update/Controller/Index/Index.php
parent 4064deff
......@@ -87,6 +87,11 @@ class Migration extends Modules\Installer\AbstractMigration
46 => [
"INSERT INTO `{pre}settings` (`id`, `module_id`, `name`, `value`) VALUES ('', '{moduleId}', 'order_by', 'date');",
"INSERT INTO `{pre}acl_resources` (`id`, `module_id`, `area`, `controller`, `page`, `params`, `privilege_id`) VALUES('', '{moduleId}', 'admin', 'index', 'sort', '', 4);",
],
47 => [
"ALTER TABLE `{pre}files` CHANGE `category_id` `category_id` INT(10) UNSIGNED;",
"ALTER TABLE `{pre}files` DROP FOREIGN KEY `acp3_files_ibfk_1`;",
"ALTER TABLE `{pre}files` ADD FOREIGN KEY (`category_id`) REFERENCES `{pre}categories` (`id`) ON DELETE SET NULL",
]
];
}
......
......@@ -59,7 +59,7 @@ class Schema implements Modules\Installer\SchemaInterface
*/
public function getSchemaVersion()
{
return 46;
return 47;
}
/**
......@@ -74,7 +74,7 @@ class Schema implements Modules\Installer\SchemaInterface
`start` DATETIME NOT NULL,
`end` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL,
`category_id` INT(10) UNSIGNED NOT NULL,
`category_id` INT(10) UNSIGNED,
`file` VARCHAR(120) NOT NULL,
`size` VARCHAR(20) NOT NULL,
`title` VARCHAR(255) NOT NULL,
......@@ -87,7 +87,7 @@ class Schema implements Modules\Installer\SchemaInterface
INDEX `foreign_category_id` (`category_id`),
INDEX (`user_id`),
INDEX (`sort`),
FOREIGN KEY (`category_id`) REFERENCES `{pre}categories` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`category_id`) REFERENCES `{pre}categories` (`id`) ON DELETE SET NULL,
FOREIGN KEY (`user_id`) REFERENCES `{pre}users` (`id`) ON DELETE SET NULL
) {ENGINE} {CHARSET};"
];
......
......@@ -63,6 +63,11 @@ class Migration extends Modules\Installer\AbstractMigration
"ALTER TABLE `{pre}news` ADD COLUMN `active` TINYINT(1) UNSIGNED NOT NULL AFTER `id`;",
"ALTER TABLE `{pre}news` ADD INDEX (`active`)",
"UPDATE `{pre}news` SET `active` = 1;"
],
43 => [
"ALTER TABLE `{pre}news` CHANGE `category_id` `category_id` INT(10) UNSIGNED;",
"ALTER TABLE `{pre}news` DROP FOREIGN KEY `acp3_news_ibfk_1`;",
"ALTER TABLE `{pre}news` ADD FOREIGN KEY (`category_id`) REFERENCES `{pre}categories` (`id`) ON DELETE SET NULL",
]
];
}
......
......@@ -57,7 +57,7 @@ class Schema implements Modules\Installer\SchemaInterface
*/
public function getSchemaVersion()
{
return 42;
return 43;
}
/**
......@@ -76,7 +76,7 @@ class Schema implements Modules\Installer\SchemaInterface
`text` TEXT NOT NULL,
`readmore` TINYINT(1) UNSIGNED NOT NULL,
`comments` TINYINT(1) UNSIGNED NOT NULL,
`category_id` INT(10) UNSIGNED NOT NULL,
`category_id` INT(10) UNSIGNED,
`uri` VARCHAR(120) NOT NULL,
`target` TINYINT(1) UNSIGNED NOT NULL,
`link_title` VARCHAR(120) NOT NULL,
......@@ -86,7 +86,7 @@ class Schema implements Modules\Installer\SchemaInterface
INDEX (`active`),
INDEX `foreign_category_id` (`category_id`),
INDEX (`user_id`),
FOREIGN KEY (`category_id`) REFERENCES `{pre}categories` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`category_id`) REFERENCES `{pre}categories` (`id`) ON DELETE SET NULL,
FOREIGN KEY (`user_id`) REFERENCES `{pre}users` (`id`) ON DELETE SET NULL
) {ENGINE} {CHARSET};"
];
......
......@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Added the new Smarty function `site_subtitle` which exposes the site's subtitle to the frontend
- When inside the administration and creating/editing a resultset, you can now choose between `save and close` and `save and continue`
### Changed
- When deleting a category, the associated news or downloads won't be deleted anymore
## [4.14.0] - 2017-10-22
### Changed
- Added an explicit breadcrumb to the imprint controller action of the contact module, as the imprint is not directly associated with the contact form
......
......@@ -3,7 +3,7 @@
<keys>
<item key="db_update_description">To start the database update, please click on the button below.</item>
<item key="db_update_error">While updating the database an error has occurred!</item>
<item key="db_update_next_steps">The database has been successfully updated. You may now return to your website, but please follow the instructions below.</item>
<item key="db_update_next_steps">The database has been successfully updated. You may return to your website now, but please follow the instructions below.</item>
<item key="db_update_no_update">The most recent version is already installed!</item>
<item key="db_update_text">Update of module &quot;%module%&quot;:</item>
<item key="db_update_success">The database has been successfully updated!</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment