aboutsummaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/DoctrineMigrations/Version20160906180558.php35
-rw-r--r--app/config/config.yml2
-rw-r--r--app/config/routing.yml4
3 files changed, 41 insertions, 0 deletions
diff --git a/app/DoctrineMigrations/Version20160906180558.php b/app/DoctrineMigrations/Version20160906180558.php
new file mode 100644
index 00000000..227bb20f
--- /dev/null
+++ b/app/DoctrineMigrations/Version20160906180558.php
@@ -0,0 +1,35 @@
1<?php
2
3namespace Application\Migrations;
4
5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema;
7
8/**
9 * Auto-generated Migration: Please modify to your needs!
10 */
11class Version20160906180558 extends AbstractMigration
12{
13 /**
14 * @param Schema $schema
15 */
16 public function up(Schema $schema)
17 {
18 $this->addSql('CREATE TABLE `wallabag_group` (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, roles LONGTEXT NOT NULL, UNIQUE INDEX UNIQ_B2305B375E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
19 $this->addSql('CREATE TABLE wallabag_user_group (user_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_6E85169A76ED395 (user_id), INDEX IDX_6E85169FE54D947 (group_id), PRIMARY KEY(user_id, group_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
20 $this->addSql('ALTER TABLE wallabag_user_group ADD CONSTRAINT FK_6E85169A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id)');
21 $this->addSql('ALTER TABLE wallabag_user_group ADD CONSTRAINT FK_6E85169FE54D947 FOREIGN KEY (group_id) REFERENCES `wallabag_group` (id)');
22 }
23
24 /**
25 * @param Schema $schema
26 */
27 public function down(Schema $schema)
28 {
29 $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\'.');
30
31 $this->addSql('ALTER TABLE wallabag_user_group DROP FOREIGN KEY FK_6E85169FE54D947');
32 $this->addSql('DROP TABLE `wallabag_group`');
33 $this->addSql('DROP TABLE wallabag_user_group');
34 }
35}
diff --git a/app/config/config.yml b/app/config/config.yml
index 2bc5e3b3..f1d93aaa 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -178,6 +178,8 @@ fos_user:
178 db_driver: orm 178 db_driver: orm
179 firewall_name: secured_area 179 firewall_name: secured_area
180 user_class: Wallabag\UserBundle\Entity\User 180 user_class: Wallabag\UserBundle\Entity\User
181 group:
182 group_class: Wallabag\UserBundle\Entity\Group
181 registration: 183 registration:
182 confirmation: 184 confirmation:
183 enabled: "%fosuser_confirmation%" 185 enabled: "%fosuser_confirmation%"
diff --git a/app/config/routing.yml b/app/config/routing.yml
index 0bd2d130..9c916f7d 100644
--- a/app/config/routing.yml
+++ b/app/config/routing.yml
@@ -41,6 +41,10 @@ homepage:
41fos_user: 41fos_user:
42 resource: "@FOSUserBundle/Resources/config/routing/all.xml" 42 resource: "@FOSUserBundle/Resources/config/routing/all.xml"
43 43
44fos_user_group:
45 resource: "@FOSUserBundle/Resources/config/routing/group.xml"
46 prefix: /group
47
44fos_oauth_server_token: 48fos_oauth_server_token:
45 resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml" 49 resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"
46 50