From 820c929ab38273c80d0930e2e6140dd7676ba4df Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 26 Mar 2016 14:43:41 -0400 Subject: Added avatar image upload --- app/Schema/Mysql.php | 7 ++++++- app/Schema/Postgres.php | 7 ++++++- app/Schema/Sqlite.php | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 9bfe6649..ccb5a9cf 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,12 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 108; +const VERSION = 109; + +function version_109(PDO $pdo) +{ + $pdo->exec("ALTER TABLE users ADD COLUMN avatar_path VARCHAR(255)"); +} function version_108(PDO $pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 28c563de..3ef49498 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,12 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 88; +const VERSION = 89; + +function version_89(PDO $pdo) +{ + $pdo->exec("ALTER TABLE users ADD COLUMN avatar_path VARCHAR(255)"); +} function version_88(PDO $pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index c6f60332..9ded7ed9 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,12 @@ use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; use PDO; -const VERSION = 100; +const VERSION = 101; + +function version_101(PDO $pdo) +{ + $pdo->exec("ALTER TABLE users ADD COLUMN avatar_path TEXT"); +} function version_100(PDO $pdo) { -- cgit v1.2.3 From f11fccd0d78ab037e77cd973a9168eedcb609fc2 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 27 Mar 2016 15:32:29 -0400 Subject: Fix bad unique constraints in Mysql table user_has_notifications --- ChangeLog | 2 ++ app/Model/UserNotification.php | 19 ++++++++----------- app/Model/UserNotificationFilter.php | 9 +++++++-- app/Schema/Mysql.php | 11 ++++++++++- app/Template/user/notifications.php | 3 --- tests/units/Model/UserNotificationFilterTest.php | 5 +++-- 6 files changed, 30 insertions(+), 19 deletions(-) (limited to 'app/Schema') diff --git a/ChangeLog b/ChangeLog index 5fded0d4..0da552ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ New features: Improvements: +* Improve notification configuration form * Handle state in OAuth2 client * Allow to use the original template in overridden templates * Unification of the project header @@ -30,6 +31,7 @@ Improvements: Bug fixes: +* Fix bad unique constraints in Mysql table user_has_notifications * Force integer type for aggregated metrics (Burndown chart concat values instead of summing) * Fixes cycle time calculation when the start date is defined in the future * Access allowed to any tasks from the shared public board by changing the URL parameters diff --git a/app/Model/UserNotification.php b/app/Model/UserNotification.php index e8a967ac..7795da2e 100644 --- a/app/Model/UserNotification.php +++ b/app/Model/UserNotification.php @@ -117,23 +117,20 @@ class UserNotification extends Base */ public function saveSettings($user_id, array $values) { - $this->db->startTransaction(); + $types = empty($values['notification_types']) ? array() : array_keys($values['notification_types']); - if (isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1) { + if (! empty($types)) { $this->enableNotification($user_id); - - $filter = empty($values['notifications_filter']) ? UserNotificationFilter::FILTER_BOTH : $values['notifications_filter']; - $projects = empty($values['notification_projects']) ? array() : array_keys($values['notification_projects']); - $types = empty($values['notification_types']) ? array() : array_keys($values['notification_types']); - - $this->userNotificationFilter->saveFilter($user_id, $filter); - $this->userNotificationFilter->saveSelectedProjects($user_id, $projects); - $this->userNotificationType->saveSelectedTypes($user_id, $types); } else { $this->disableNotification($user_id); } - $this->db->closeTransaction(); + $filter = empty($values['notifications_filter']) ? UserNotificationFilter::FILTER_BOTH : $values['notifications_filter']; + $project_ids = empty($values['notification_projects']) ? array() : array_keys($values['notification_projects']); + + $this->userNotificationFilter->saveFilter($user_id, $filter); + $this->userNotificationFilter->saveSelectedProjects($user_id, $project_ids); + $this->userNotificationType->saveSelectedTypes($user_id, $types); } /** diff --git a/app/Model/UserNotificationFilter.php b/app/Model/UserNotificationFilter.php index d4afd278..780ddfc7 100644 --- a/app/Model/UserNotificationFilter.php +++ b/app/Model/UserNotificationFilter.php @@ -61,10 +61,11 @@ class UserNotificationFilter extends Base * @access public * @param integer $user_id * @param string $filter + * @return boolean */ public function saveFilter($user_id, $filter) { - $this->db->table(User::TABLE)->eq('id', $user_id)->update(array( + return $this->db->table(User::TABLE)->eq('id', $user_id)->update(array( 'notifications_filter' => $filter, )); } @@ -87,17 +88,21 @@ class UserNotificationFilter extends Base * @access public * @param integer $user_id * @param integer[] $project_ids + * @return boolean */ public function saveSelectedProjects($user_id, array $project_ids) { + $results = array(); $this->db->table(self::PROJECT_TABLE)->eq('user_id', $user_id)->remove(); foreach ($project_ids as $project_id) { - $this->db->table(self::PROJECT_TABLE)->insert(array( + $results[] = $this->db->table(self::PROJECT_TABLE)->insert(array( 'user_id' => $user_id, 'project_id' => $project_id, )); } + + return !in_array(false, $results, true); } /** diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index ccb5a9cf..a041b3dc 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,16 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 109; +const VERSION = 110; + +function version_110(PDO $pdo) +{ + $pdo->exec("ALTER TABLE user_has_notifications DROP FOREIGN KEY `user_has_notifications_ibfk_1`"); + $pdo->exec("ALTER TABLE user_has_notifications DROP FOREIGN KEY `user_has_notifications_ibfk_2`"); + $pdo->exec("DROP INDEX `project_id` ON user_has_notifications"); + $pdo->exec("ALTER TABLE user_has_notifications DROP KEY `user_id`"); + $pdo->exec("CREATE UNIQUE INDEX `user_has_notifications_unique_idx` ON `user_has_notifications` (`user_id`, `project_id`)"); +} function version_109(PDO $pdo) { diff --git a/app/Template/user/notifications.php b/app/Template/user/notifications.php index 2a5c8152..6e1a0004 100644 --- a/app/Template/user/notifications.php +++ b/app/Template/user/notifications.php @@ -3,11 +3,8 @@
- form->csrf() ?> - form->checkbox('notifications_enabled', t('Enable notifications'), '1', $notifications['notifications_enabled'] == 1) ?>
-

form->checkboxes('notification_types', $types, $notifications) ?> diff --git a/tests/units/Model/UserNotificationFilterTest.php b/tests/units/Model/UserNotificationFilterTest.php index 0b5f1d98..924f0883 100644 --- a/tests/units/Model/UserNotificationFilterTest.php +++ b/tests/units/Model/UserNotificationFilterTest.php @@ -26,10 +26,11 @@ class UserNotificationFilterTest extends Base $this->assertEquals(1, $p->create(array('name' => 'UnitTest1'))); $this->assertEquals(2, $p->create(array('name' => 'UnitTest2'))); + $this->assertEquals(3, $p->create(array('name' => 'UnitTest3'))); $this->assertEmpty($nf->getSelectedProjects(1)); - $nf->saveSelectedProjects(1, array(1, 2)); - $this->assertEquals(array(1, 2), $nf->getSelectedProjects(1)); + $this->assertTrue($nf->saveSelectedProjects(1, array(1, 2, 3))); + $this->assertEquals(array(1, 2, 3), $nf->getSelectedProjects(1)); } public function testSaveUserFilter() -- cgit v1.2.3 From 004fde30f7cc0dd4864c50f8d804da9679f524fa Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 27 Mar 2016 16:21:15 -0400 Subject: Update SQL dumps and improve schema migration process --- ChangeLog | 1 + app/Schema/Mysql.php | 2 + app/Schema/Sql/mysql.sql | 17 ++++++-- app/Schema/Sql/postgres.sql | 67 ++++++++++++++++++-------------- app/ServiceProvider/DatabaseProvider.php | 4 +- composer.json | 2 +- composer.lock | 54 ++++++++++++------------- 7 files changed, 84 insertions(+), 63 deletions(-) (limited to 'app/Schema') diff --git a/ChangeLog b/ChangeLog index 0da552ed..000ab61b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ New features: Improvements: +* Improve schema migration process * Improve notification configuration form * Handle state in OAuth2 client * Allow to use the original template in overridden templates diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index a041b3dc..934b063f 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -15,6 +15,8 @@ function version_110(PDO $pdo) $pdo->exec("DROP INDEX `project_id` ON user_has_notifications"); $pdo->exec("ALTER TABLE user_has_notifications DROP KEY `user_id`"); $pdo->exec("CREATE UNIQUE INDEX `user_has_notifications_unique_idx` ON `user_has_notifications` (`user_id`, `project_id`)"); + $pdo->exec("ALTER TABLE user_has_notifications ADD CONSTRAINT user_has_notifications_ibfk_1 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE"); + $pdo->exec("ALTER TABLE user_has_notifications ADD CONSTRAINT user_has_notifications_ibfk_2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE"); } function version_109(PDO $pdo) diff --git a/app/Schema/Sql/mysql.sql b/app/Schema/Sql/mysql.sql index b5620400..ce2374f0 100644 --- a/app/Schema/Sql/mysql.sql +++ b/app/Schema/Sql/mysql.sql @@ -273,6 +273,8 @@ CREATE TABLE `project_has_metadata` ( `project_id` int(11) NOT NULL, `name` varchar(50) NOT NULL, `value` varchar(255) DEFAULT '', + `changed_by` int(11) NOT NULL DEFAULT '0', + `changed_on` int(11) NOT NULL DEFAULT '0', UNIQUE KEY `project_id` (`project_id`,`name`), CONSTRAINT `project_has_metadata_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -357,6 +359,8 @@ DROP TABLE IF EXISTS `settings`; CREATE TABLE `settings` ( `option` varchar(100) NOT NULL, `value` varchar(255) DEFAULT '', + `changed_by` int(11) NOT NULL DEFAULT '0', + `changed_on` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`option`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -469,6 +473,8 @@ CREATE TABLE `task_has_metadata` ( `task_id` int(11) NOT NULL, `name` varchar(50) NOT NULL, `value` varchar(255) DEFAULT '', + `changed_by` int(11) NOT NULL DEFAULT '0', + `changed_on` int(11) NOT NULL DEFAULT '0', UNIQUE KEY `task_id` (`task_id`,`name`), CONSTRAINT `task_has_metadata_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -548,6 +554,8 @@ CREATE TABLE `user_has_metadata` ( `user_id` int(11) NOT NULL, `name` varchar(50) NOT NULL, `value` varchar(255) DEFAULT '', + `changed_by` int(11) NOT NULL DEFAULT '0', + `changed_on` int(11) NOT NULL DEFAULT '0', UNIQUE KEY `user_id` (`user_id`,`name`), CONSTRAINT `user_has_metadata_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -570,8 +578,8 @@ DROP TABLE IF EXISTS `user_has_notifications`; CREATE TABLE `user_has_notifications` ( `user_id` int(11) NOT NULL, `project_id` int(11) NOT NULL, - UNIQUE KEY `project_id` (`project_id`,`user_id`), - KEY `user_id` (`user_id`), + UNIQUE KEY `user_has_notifications_unique_idx` (`user_id`,`project_id`), + KEY `user_has_notifications_ibfk_2` (`project_id`), CONSTRAINT `user_has_notifications_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `user_has_notifications_ibfk_2` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -615,6 +623,7 @@ CREATE TABLE `users` ( `gitlab_id` int(11) DEFAULT NULL, `role` varchar(25) NOT NULL DEFAULT 'app-user', `is_active` tinyint(1) DEFAULT '1', + `avatar_path` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_username_idx` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -638,7 +647,7 @@ CREATE TABLE `users` ( LOCK TABLES `settings` WRITE; /*!40000 ALTER TABLE `settings` DISABLE KEYS */; -INSERT INTO `settings` VALUES ('api_token','cd9c46c6bdaa6afc49b3385dabe0b78c059bc124b1f72c2f47c9ca604cf1'),('application_currency','USD'),('application_date_format','m/d/Y'),('application_language','en_US'),('application_stylesheet',''),('application_timezone','UTC'),('application_url',''),('board_columns',''),('board_highlight_period','172800'),('board_private_refresh_interval','10'),('board_public_refresh_interval','60'),('calendar_project_tasks','date_started'),('calendar_user_subtasks_time_tracking','0'),('calendar_user_tasks','date_started'),('cfd_include_closed_tasks','1'),('default_color','yellow'),('integration_gravatar','0'),('password_reset','1'),('project_categories',''),('subtask_restriction','0'),('subtask_time_tracking','1'),('webhook_token','32387b121de8fe6031a6b71b7b1b9cae411a909539aa9d494cf69ac5f2ee'),('webhook_url',''); +INSERT INTO `settings` VALUES ('api_token','9c55053ae1d523893efc820e2e8338c4cf47f5c6c2c26861fec637eba62b',0,0),('application_currency','USD',0,0),('application_date_format','m/d/Y',0,0),('application_language','en_US',0,0),('application_stylesheet','',0,0),('application_timezone','UTC',0,0),('application_url','',0,0),('board_columns','',0,0),('board_highlight_period','172800',0,0),('board_private_refresh_interval','10',0,0),('board_public_refresh_interval','60',0,0),('calendar_project_tasks','date_started',0,0),('calendar_user_subtasks_time_tracking','0',0,0),('calendar_user_tasks','date_started',0,0),('cfd_include_closed_tasks','1',0,0),('default_color','yellow',0,0),('integration_gravatar','0',0,0),('password_reset','1',0,0),('project_categories','',0,0),('subtask_restriction','0',0,0),('subtask_time_tracking','1',0,0),('webhook_token','aaed762f4f6b0860902af0e2a87e5ad3427d24ff9e3ce8a2e0b005b58dfc',0,0),('webhook_url','',0,0); /*!40000 ALTER TABLE `settings` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -667,4 +676,4 @@ UNLOCK TABLES; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -INSERT INTO users (username, password, role) VALUES ('admin', '$2y$10$tyByY1dfUO9S.2wpJcSMEO4UU9H.yCwf/pmzo430DM2C4QZ/K3Kt2', 'app-admin');INSERT INTO schema_version VALUES ('107'); +INSERT INTO users (username, password, role) VALUES ('admin', '$2y$10$e.SftITKuBvXeNbxtmTKS.KAbIy4Mx09t254BAiEAuWOxkuS4xfLG', 'app-admin');INSERT INTO schema_version VALUES ('110'); diff --git a/app/Schema/Sql/postgres.sql b/app/Schema/Sql/postgres.sql index c613ddb4..48a269d3 100644 --- a/app/Schema/Sql/postgres.sql +++ b/app/Schema/Sql/postgres.sql @@ -512,7 +512,9 @@ CREATE TABLE project_has_groups ( CREATE TABLE project_has_metadata ( project_id integer NOT NULL, name character varying(50) NOT NULL, - value character varying(255) DEFAULT ''::character varying + value character varying(255) DEFAULT ''::character varying, + changed_by integer DEFAULT 0 NOT NULL, + changed_on integer DEFAULT 0 NOT NULL ); @@ -652,7 +654,9 @@ CREATE TABLE schema_version ( CREATE TABLE settings ( option character varying(100) NOT NULL, - value character varying(255) DEFAULT ''::character varying + value character varying(255) DEFAULT ''::character varying, + changed_by integer DEFAULT 0 NOT NULL, + changed_on integer DEFAULT 0 NOT NULL ); @@ -847,7 +851,9 @@ ALTER SEQUENCE task_has_links_id_seq OWNED BY task_has_links.id; CREATE TABLE task_has_metadata ( task_id integer NOT NULL, name character varying(50) NOT NULL, - value character varying(255) DEFAULT ''::character varying + value character varying(255) DEFAULT ''::character varying, + changed_by integer DEFAULT 0 NOT NULL, + changed_on integer DEFAULT 0 NOT NULL ); @@ -969,7 +975,9 @@ ALTER SEQUENCE transitions_id_seq OWNED BY transitions.id; CREATE TABLE user_has_metadata ( user_id integer NOT NULL, name character varying(50) NOT NULL, - value character varying(255) DEFAULT ''::character varying + value character varying(255) DEFAULT ''::character varying, + changed_by integer DEFAULT 0 NOT NULL, + changed_on integer DEFAULT 0 NOT NULL ); @@ -1070,7 +1078,8 @@ CREATE TABLE users ( lock_expiration_date bigint DEFAULT 0, gitlab_id integer, role character varying(25) DEFAULT 'app-user'::character varying NOT NULL, - is_active boolean DEFAULT true + is_active boolean DEFAULT true, + avatar_path character varying(255) ); @@ -2141,29 +2150,29 @@ SET search_path = public, pg_catalog; -- Data for Name: settings; Type: TABLE DATA; Schema: public; Owner: postgres -- -INSERT INTO settings (option, value) VALUES ('board_highlight_period', '172800'); -INSERT INTO settings (option, value) VALUES ('board_public_refresh_interval', '60'); -INSERT INTO settings (option, value) VALUES ('board_private_refresh_interval', '10'); -INSERT INTO settings (option, value) VALUES ('board_columns', ''); -INSERT INTO settings (option, value) VALUES ('webhook_token', 'c7caaf8f87ad391800e3989d7abfd98a6066a6f801fc151012bb5c4ee3cb'); -INSERT INTO settings (option, value) VALUES ('api_token', 'b0a6f56fe236fc9639fc6914e92365aa627d95cd790aa7e0c5a3ebebf844'); -INSERT INTO settings (option, value) VALUES ('application_language', 'en_US'); -INSERT INTO settings (option, value) VALUES ('application_timezone', 'UTC'); -INSERT INTO settings (option, value) VALUES ('application_url', ''); -INSERT INTO settings (option, value) VALUES ('application_date_format', 'm/d/Y'); -INSERT INTO settings (option, value) VALUES ('project_categories', ''); -INSERT INTO settings (option, value) VALUES ('subtask_restriction', '0'); -INSERT INTO settings (option, value) VALUES ('application_stylesheet', ''); -INSERT INTO settings (option, value) VALUES ('application_currency', 'USD'); -INSERT INTO settings (option, value) VALUES ('integration_gravatar', '0'); -INSERT INTO settings (option, value) VALUES ('calendar_user_subtasks_time_tracking', '0'); -INSERT INTO settings (option, value) VALUES ('calendar_user_tasks', 'date_started'); -INSERT INTO settings (option, value) VALUES ('calendar_project_tasks', 'date_started'); -INSERT INTO settings (option, value) VALUES ('webhook_url', ''); -INSERT INTO settings (option, value) VALUES ('default_color', 'yellow'); -INSERT INTO settings (option, value) VALUES ('subtask_time_tracking', '1'); -INSERT INTO settings (option, value) VALUES ('cfd_include_closed_tasks', '1'); -INSERT INTO settings (option, value) VALUES ('password_reset', '1'); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('board_highlight_period', '172800', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('board_public_refresh_interval', '60', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('board_private_refresh_interval', '10', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('board_columns', '', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('webhook_token', '67545fef6a0a3f43d60c7d57632d6e4af9930f064c12e72266b1c9b42381', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('api_token', 'c16b1c5896b258409a5eb344152b5b33c8ef4c58902bc543fc1348c37975', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('application_language', 'en_US', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('application_timezone', 'UTC', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('application_url', '', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('application_date_format', 'm/d/Y', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('project_categories', '', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('subtask_restriction', '0', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('application_stylesheet', '', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('application_currency', 'USD', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('integration_gravatar', '0', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('calendar_user_subtasks_time_tracking', '0', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('calendar_user_tasks', 'date_started', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('calendar_project_tasks', 'date_started', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('webhook_url', '', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('default_color', 'yellow', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('subtask_time_tracking', '1', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('cfd_include_closed_tasks', '1', 0, 0); +INSERT INTO settings (option, value, changed_by, changed_on) VALUES ('password_reset', '1', 0, 0); -- @@ -2211,4 +2220,4 @@ SELECT pg_catalog.setval('links_id_seq', 11, true); -- PostgreSQL database dump complete -- -INSERT INTO users (username, password, role) VALUES ('admin', '$2y$10$tyByY1dfUO9S.2wpJcSMEO4UU9H.yCwf/pmzo430DM2C4QZ/K3Kt2', 'app-admin');INSERT INTO schema_version VALUES ('87'); +INSERT INTO users (username, password, role) VALUES ('admin', '$2y$10$e.SftITKuBvXeNbxtmTKS.KAbIy4Mx09t254BAiEAuWOxkuS4xfLG', 'app-admin');INSERT INTO schema_version VALUES ('89'); diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php index 8cede8af..d323807d 100644 --- a/app/ServiceProvider/DatabaseProvider.php +++ b/app/ServiceProvider/DatabaseProvider.php @@ -44,8 +44,8 @@ class DatabaseProvider implements ServiceProviderInterface if ($db->schema()->check(\Schema\VERSION)) { return $db; } else { - $errors = $db->getLogMessages(); - throw new RuntimeException('Unable to migrate database schema: '.(isset($errors[0]) ? $errors[0] : 'Unknown error')); + $messages = $db->getLogMessages(); + throw new RuntimeException('Unable to run SQL migrations: '.implode(', ', $messages).' (You may have to fix it manually)'); } } diff --git a/composer.json b/composer.json index 969b0606..5dd9a4cf 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "eluceo/ical": "0.8.0", "erusev/parsedown" : "1.6.0", "fguillot/json-rpc" : "1.0.3", - "fguillot/picodb" : "1.0.7", + "fguillot/picodb" : "1.0.8", "fguillot/simpleLogger" : "1.0.0", "fguillot/simple-validator" : "1.0.0", "paragonie/random_compat": "@stable", diff --git a/composer.lock b/composer.lock index caeb4906..438118a2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d60e4b6b7ceb60202c48112ffbc33fba", - "content-hash": "fbb704fa621ed6dd3c60241913ea1686", + "hash": "ecdd93c089273876816339ff22d67cc7", + "content-hash": "a5edc6f9c9ae2cd356e3f8ac96ef5532", "packages": [ { "name": "christian-riesen/base32", @@ -239,16 +239,16 @@ }, { "name": "fguillot/picodb", - "version": "v1.0.7", + "version": "v1.0.8", "source": { "type": "git", "url": "https://github.com/fguillot/picoDb.git", - "reference": "7f36dc3a7814ca0fc63439cd948e8acfeda672de" + "reference": "672a819ba2757a9e22a3572a230e735e84bcf625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fguillot/picoDb/zipball/7f36dc3a7814ca0fc63439cd948e8acfeda672de", - "reference": "7f36dc3a7814ca0fc63439cd948e8acfeda672de", + "url": "https://api.github.com/repos/fguillot/picoDb/zipball/672a819ba2757a9e22a3572a230e735e84bcf625", + "reference": "672a819ba2757a9e22a3572a230e735e84bcf625", "shasum": "" }, "require": { @@ -272,7 +272,7 @@ ], "description": "Minimalist database query builder", "homepage": "https://github.com/fguillot/picoDb", - "time": "2016-03-12 14:31:33" + "time": "2016-03-27 20:15:25" }, { "name": "fguillot/simple-validator", @@ -397,16 +397,16 @@ }, { "name": "paragonie/random_compat", - "version": "v1.2.2", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "b3313b618f4edd76523572531d5d7e22fe747430" + "reference": "76e90f747b769b347fe584e8015a014549107d35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/b3313b618f4edd76523572531d5d7e22fe747430", - "reference": "b3313b618f4edd76523572531d5d7e22fe747430", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/76e90f747b769b347fe584e8015a014549107d35", + "reference": "76e90f747b769b347fe584e8015a014549107d35", "shasum": "" }, "require": { @@ -441,7 +441,7 @@ "pseudorandom", "random" ], - "time": "2016-03-11 19:54:08" + "time": "2016-03-18 20:36:13" }, { "name": "pimple/pimple", @@ -627,16 +627,16 @@ }, { "name": "symfony/console", - "version": "v2.8.3", + "version": "v2.8.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "56cc5caf051189720b8de974e4746090aaa10d44" + "reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/56cc5caf051189720b8de974e4746090aaa10d44", - "reference": "56cc5caf051189720b8de974e4746090aaa10d44", + "url": "https://api.github.com/repos/symfony/console/zipball/9a5aef5fc0d4eff86853d44202b02be8d5a20154", + "reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154", "shasum": "" }, "require": { @@ -683,20 +683,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-02-28 16:20:50" + "time": "2016-03-17 09:19:04" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.3", + "version": "v2.8.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3" + "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/78c468665c9568c3faaa9c416a7134308f2d85c3", - "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/47d2d8cade9b1c3987573d2943bb9352536cdb87", + "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87", "shasum": "" }, "require": { @@ -743,7 +743,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-01-27 05:14:19" + "time": "2016-03-07 14:04:32" }, { "name": "symfony/polyfill-mbstring", @@ -808,16 +808,16 @@ "packages-dev": [ { "name": "symfony/stopwatch", - "version": "v2.8.3", + "version": "v2.8.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "e3bc8e2a984f4382690a438c8bb650f3ffd71e73" + "reference": "9e24824b2a9a16e17ab997f61d70bc03948e434e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e3bc8e2a984f4382690a438c8bb650f3ffd71e73", - "reference": "e3bc8e2a984f4382690a438c8bb650f3ffd71e73", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/9e24824b2a9a16e17ab997f61d70bc03948e434e", + "reference": "9e24824b2a9a16e17ab997f61d70bc03948e434e", "shasum": "" }, "require": { @@ -853,7 +853,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2016-01-03 15:33:41" + "time": "2016-03-04 07:54:35" } ], "aliases": [], -- cgit v1.2.3