-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more statistics at the instance level (#661)
The DB has changed a lot in the last months. If we want to be able to track how people are using the application, we need to add more statistics at the instance level. This shouldn't be too hard on the DB to calculate those every night at midnight.
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
database/migrations/2017_11_27_083043_add_more_statistics.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AddMoreStatistics extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('statistics', function (Blueprint $table) { | ||
$table->integer('number_of_activities')->after('number_of_kids'); | ||
$table->integer('number_of_addresses')->after('number_of_activities'); | ||
$table->integer('number_of_api_calls')->after('number_of_addresses'); | ||
$table->integer('number_of_calls')->after('number_of_api_calls'); | ||
$table->integer('number_of_contact_fields')->after('number_of_calls'); | ||
$table->integer('number_of_contact_field_types')->after('number_of_contact_fields'); | ||
$table->integer('number_of_debts')->after('number_of_contact_field_types'); | ||
$table->integer('number_of_entries')->after('number_of_debts'); | ||
$table->integer('number_of_gifts')->after('number_of_entries'); | ||
$table->integer('number_of_oauth_access_tokens')->after('number_of_notes'); | ||
$table->integer('number_of_oauth_clients')->after('number_of_oauth_access_tokens'); | ||
$table->integer('number_of_offsprings')->after('number_of_oauth_clients'); | ||
$table->integer('number_of_progenitors')->after('number_of_offsprings'); | ||
$table->integer('number_of_relationships')->after('number_of_progenitors'); | ||
$table->integer('number_of_subscriptions')->after('number_of_relationships'); | ||
}); | ||
} | ||
} |