RVRNEXT-24 add migration for slug for communities
This commit is contained in:
parent
57bdfdb1aa
commit
6d6e93d711
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use RVR\PersistentData\Model\Community;
|
||||||
|
use SokoWeb\Database\Query\Select;
|
||||||
|
|
||||||
|
$select = new Select(Container::$dbConnection);
|
||||||
|
$communities = Container::$persistentDataManager->selectMultipleFromDb($select, Community::class);
|
||||||
|
|
||||||
|
foreach ($communities as $community) {
|
||||||
|
$community->generateSlug();
|
||||||
|
Container::$persistentDataManager->saveToDb($community);
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE `communities`
|
||||||
|
ADD `slug` varchar(255) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL AFTER `id`,
|
||||||
|
ADD UNIQUE `slug` (`slug`);
|
Loading…
Reference in New Issue
Block a user