From 3e4573027caaa762346f091cf8928390a585d475 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Mon, 8 Aug 2016 22:20:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=20oauth=20=D0=BF=D1=80=D0=B8=D0=BB=D0=BE?= =?UTF-8?q?=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BE=20Ely.by?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/m160808_191142_ely_by_app.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 console/migrations/m160808_191142_ely_by_app.php diff --git a/console/migrations/m160808_191142_ely_by_app.php b/console/migrations/m160808_191142_ely_by_app.php new file mode 100644 index 0000000..c57f555 --- /dev/null +++ b/console/migrations/m160808_191142_ely_by_app.php @@ -0,0 +1,32 @@ +db->createCommand(' + SELECT COUNT(*) + FROM {{%oauth_clients}} + WHERE id = "ely" + LIMIT 1 + ')->queryScalar(); + + if (!$exists) { + $this->insert('{{%oauth_clients}}', [ + 'id' => 'ely', + 'secret' => 'change_this_on_production', + 'name' => 'Ely.by', + 'description' => '', + 'redirect_uri' => 'http://ely.by/authorization/oauth', + 'is_trusted' => 1, + 'created_at' => time(), + ]); + } + } + + public function safeDown() { + $this->delete('{{%oauth_clients}}', ['id' => 'ely']); + } + +}