Skip to content

Commit

Permalink
Bump version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiz committed Jan 18, 2017
1 parent f229c6a commit be34674
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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!
Expand Down
17 changes: 12 additions & 5 deletions bin/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions docs/Upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion phplib/411bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit be34674

Please sign in to comment.