Skip to content

Commit

Permalink
Merge pull request #91 from anstiftung/issue-88-reparaturwissen
Browse files Browse the repository at this point in the history
Issue 88 reparaturwissen
  • Loading branch information
mrothauer authored Apr 25, 2022
2 parents b7096bf + e6e081d commit d479fa3
Show file tree
Hide file tree
Showing 27 changed files with 977 additions and 322 deletions.
56 changes: 56 additions & 0 deletions config/Migrations/20220404070045_Knowledge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);

use Migrations\AbstractMigration;

class Knowledge extends AbstractMigration
{
public function change()
{
$sql = "ALTER TABLE `roots` CHANGE `object_type` `object_type` ENUM('pages','users','posts','workshops','events','coaches','votings','photos','info_sheets','knowledges') CHARACTER SET ascii COLLATE ascii_bin NULL DEFAULT NULL;";
$this->execute($sql);

$sql = "CREATE TABLE `knowledges` (
`_id` int NOT NULL,
`uid` int UNSIGNED DEFAULT NULL,
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`text` text,
`status` smallint DEFAULT NULL,
`owner` int UNSIGNED DEFAULT NULL,
`created` datetime DEFAULT NULL,
`updated` datetime DEFAULT NULL,
`updated_by` int UNSIGNED DEFAULT NULL,
`currently_updated_by` int UNSIGNED DEFAULT NULL,
`currently_updated_start` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
CREATE TABLE `knowledges_categories` (
`knowledge_uid` int UNSIGNED NOT NULL,
`category_id` int UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
CREATE TABLE `knowledges_skills` (
`knowledge_uid` int UNSIGNED NOT NULL,
`skill_id` int UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
ALTER TABLE `knowledges`
ADD PRIMARY KEY (`_id`),
ADD KEY `uid` (`uid`);
ALTER TABLE `knowledges_categories`
ADD PRIMARY KEY (`knowledge_uid`,`category_id`),
ADD KEY `knowledge_uid` (`knowledge_uid`),
ADD KEY `category_id` (`category_id`);
ALTER TABLE `knowledges_skills`
ADD PRIMARY KEY (`knowledge_uid`,`skill_id`),
ADD KEY `knowledge_uid` (`knowledge_uid`),
ADD KEY `skill_id` (`skill_id`);
ALTER TABLE `knowledges`
MODIFY `_id` int NOT NULL AUTO_INCREMENT;
COMMIT;";
$this->execute($sql);
}
}
Binary file modified config/Migrations/schema-dump-default.lock
Binary file not shown.
3 changes: 3 additions & 0 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
$routes->redirect('/initiativen', '/orte');
$routes->redirect('/splitter', '/seite/splitter');
$routes->redirect('/online-reparaturcafe', '/seite/online-reparaturcafe');
$routes->redirect('/seite/reparaturwissen', '/reparaturwissen');
$routes->redirect('/repair-cafe-ulm', '/reparatur-cafe-ulm');
/* END custom redirects */

Expand Down Expand Up @@ -66,6 +67,8 @@
$routes->connect('/users/passwortAendern', ['controller'=>'users', 'action'=>'passwortAendern']);
$routes->connect('/users/activate/*', ['controller'=>'users', 'action'=>'activate']);

$routes->connect('/reparaturwissen', ['controller'=>'knowledges', 'action'=>'all']);

$routes->connect('/users/profile/{id}', ['controller'=>'users', 'action'=>'publicProfile'])
->setPatterns(['id' => '\d+'])
->setPass(['id']);
Expand Down
Loading

0 comments on commit d479fa3

Please sign in to comment.