feature/RVRNEXT-24-use-slugs-for-communities #52

Merged
bence merged 4 commits from feature/RVRNEXT-24-use-slugs-for-communities into master 2023-05-07 01:57:57 +02:00
2 changed files with 15 additions and 0 deletions
Showing only changes of commit 829588150a - Show all commits

View File

@ -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);
}

View File

@ -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`);