Permalink
Browse files

Bump version number.

  • Loading branch information...
kiwiz committed Jan 18, 2017
1 parent f229c6a commit be34674fca3ab69c181384db52e70cafdd245ed1
Showing with 18 additions and 6 deletions.
  1. +2 −0 CONTRIBUTING.md
  2. +12 −5 bin/migration.php
  3. +3 −0 docs/Upgrading.md
  4. +1 −1 phplib/411bootstrap.php
View
@@ -1,6 +1,8 @@
Contributing
------------
+All contributions are welcome!
+
1. Open an issue to discuss the change.
1. Fork the repo and create a topic branch for your change.
2. Hack on the code!
View
@@ -40,9 +40,9 @@ function ver_cmp($a, $b) {
if(ver_cmp($old_ver, '1.0.1') < 0) {
// Add indices to speed up common queries.
- FOO\DB::query('CREATE INDEX `jobs_target_date_idx` ON `jobs`(`target_date`)');
- FOO\DB::query('CREATE INDEX `type_target_id_site_id_archived_idx` ON `jobs`(type, target_id, site_id, archived)');
- FOO\DB::query('CREATE INDEX `jobs_type_target_id_site_id_archived_idx` ON `jobs`(type, target_id, site_id, archived)');
+ FOO\DB::query('CREATE INDEX IF NOT EXISTS `jobs_target_date_idx` ON `jobs`(`target_date`)');
+ FOO\DB::query('CREATE INDEX IF NOT EXISTS `type_target_id_site_id_archived_idx` ON `jobs`(type, target_id, site_id, archived)');
+ FOO\DB::query('CREATE INDEX IF NOT EXISTS `jobs_type_target_id_site_id_archived_idx` ON `jobs`(type, target_id, site_id, archived)');
}
if(ver_cmp($old_ver, '1.1.0') < 0) {
@@ -51,16 +51,23 @@ function ver_cmp($a, $b) {
foreach($user_ids as $user_id) {
FOO\DB::query('UPDATE `users` SET `api_key`=? WHERE `user_id`=?', [FOO\Random::base64_bytes(FOO\User::API_KEY_LEN), $user_id]);
}
- FOO\DB::query('CREATE UNIQUE INDEX `users_site_id_api_key_idx` ON `users`(`site_id`, `api_key`);');
+ FOO\DB::query('CREATE UNIQUE INDEX IF NOT EXISTS `users_site_id_api_key_idx` ON `users`(`site_id`, `api_key`);');
}
if(ver_cmp($old_ver, '1.2.0') < 0) {
FOO\DB::query('ALTER TABLE `sites` ADD COLUMN `secure` BOOLEAN NOT NULL DEFAULT 1');
FOO\DB::query('ALTER TABLE `searches` ADD COLUMN `source` VARCHAR(64) NOT NULL DEFAULT ""');
- FOO\DB::query('CREATE INDEX `searches_source_idx` ON `searches`(`source`)');
+ FOO\DB::query('CREATE INDEX IF NOT EXISTS `searches_source_idx` ON `searches`(`source`)');
FOO\DB::query('UPDATE `searches` SET `source`="logstash", `type`="es" WHERE `type`="logstash"');
+
+ $gcfg = FOO\Config::get('graphite');
+ $ecfg = FOO\Config::get('elasticsearch');
+
+ if(FOO\Util::exists($gcfg, 'host') || count(array_diff(array_keys($ecfg), ['alerts', 'logstash'])) > 0) {
+ printf("NOTE: There have been some config format changes. See Upgrading.md for details.\n");
+ }
}
/**
View
@@ -16,6 +16,8 @@ Migrating from A.B.C to D.E.F
Migration complete!
```
+If you have any issues upgrading, you can open a ticket or get help on our Gitter.
+
## v1.2 ##
With the introduction of Search sources, changes were made to the following Searches:
@@ -26,6 +28,7 @@ With the introduction of Search sources, changes were made to the following Sear
If you're using any `Logstash` or `Graphite` Searches, you'll need to make some changes:
+
### Graphite ###
The config should now contain an associative array of sources. Ex:
View
@@ -20,7 +20,7 @@
date_default_timezone_set("UTC");
define('BASE_DIR', realpath(__DIR__ . '/..'));
-define('VERSION', '1.1.0');
+define('VERSION', '1.2.0');
// Set up autoloader for our classes.
spl_autoload_register(function($class) {

0 comments on commit be34674

Please sign in to comment.