From a47379cb313f5966ee1e783a0357860b7d4ba400 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 29 Mar 2016 00:21:49 +0200 Subject: Increase size of password field in DB The php documentation for password_hash recommends 255. Signed-off-by: Florian Pritz --- .../migrations/017_increase_password_length.php | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 application/migrations/017_increase_password_length.php (limited to 'application/migrations/017_increase_password_length.php') diff --git a/application/migrations/017_increase_password_length.php b/application/migrations/017_increase_password_length.php new file mode 100644 index 000000000..9d12d3f52 --- /dev/null +++ b/application/migrations/017_increase_password_length.php @@ -0,0 +1,27 @@ +db->dbprefix; + + if ($this->db->dbdriver == 'postgre') { + $this->db->query(' + ALTER TABLE "'.$prefix.'users" + ALTER COLUMN "password" type varchar(255); + '); + } else { + $this->db->query(' + ALTER TABLE `'.$prefix.'users` + CHANGE `password` `password` varchar(255); + '); + } + } + + public function down() + { + throw new \exceptions\ApiException("migration/downgrade-not-supported", "downgrade not supported"); + } +} -- cgit v1.2.3-24-g4f1b