-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new table for tracking startup trends and metrics (#510)
* chore: add startup dashboard page to get insight about whats going on in startup * chore: replaced react-tabulator by react-table * chore: replaced react-tabulator by react-table * chore: check isAdmin * chore: add signaux faibles beta page * fix: sorting negative value * feat: add startups aggregated stats * chore: add script to dry run refreshStartupAggregatedData
- Loading branch information
1 parent
e0612c8
commit 77360d4
Showing
10 changed files
with
22,654 additions
and
21,771 deletions.
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
61 changes: 61 additions & 0 deletions
61
migrations/20241023153024_add_startups_aggregated_stats.ts
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,61 @@ | ||
exports.up = function (knex) { | ||
return knex.schema.createTable( | ||
"startup_aggregated_stats", | ||
function (table) { | ||
// Defining the uuid column for startup, which will be a foreign key | ||
table.uuid("uuid").notNullable(); | ||
table.string("current_phase"); | ||
table.date("current_phase_start_date"); | ||
// Additional columns as per your requirements | ||
table.boolean("has_coach"); | ||
table.boolean("has_intra"); | ||
table.boolean("had_coach"); | ||
table.boolean("had_intra"); | ||
table.decimal("turnover_rate_value"); // decimal with 2 decimal points | ||
table.decimal("average_mission_duration_value"); | ||
table.decimal("renewal_rate_value"); | ||
table.decimal("average_replacement_frequency_value"); | ||
|
||
// devMissionsTrend columns | ||
table.decimal("dev_current"); | ||
table.decimal("dev_one_month_ago"); | ||
table.decimal("dev_two_months_ago"); | ||
table.decimal("dev_three_months_ago"); | ||
table.decimal("dev_change_from_last_month"); | ||
table.decimal("dev_trend_over_three_months"); | ||
table.decimal("dev_trend_over_six_months"); | ||
table.decimal("dev_trend_over_twelve_months"); | ||
|
||
// bizdevMissionsTrend columns | ||
table.decimal("bizdev_current"); | ||
table.decimal("bizdev_one_month_ago"); | ||
table.decimal("bizdev_two_months_ago"); | ||
table.decimal("bizdev_three_months_ago"); | ||
table.decimal("bizdev_change_from_last_month"); | ||
table.decimal("bizdev_trend_over_three_months"); | ||
table.decimal("bizdev_trend_over_six_months"); | ||
table.decimal("bizdev_trend_over_twelve_months"); | ||
|
||
// activeMember (missionsTrend) columns | ||
table.decimal("active_member_current"); | ||
table.decimal("active_member_one_month_ago"); | ||
table.decimal("active_member_two_months_ago"); | ||
table.decimal("active_member_three_months_ago"); | ||
table.decimal("active_member_change_from_last_month"); | ||
table.decimal("active_member_trend_over_three_months"); | ||
table.decimal("active_member_trend_over_six_months"); | ||
table.decimal("active_member_trend_over_twelve_months"); | ||
|
||
// Setting foreign key constraint on the 'uuid' column referencing startups.uuid | ||
table | ||
.foreign("uuid") | ||
.references("uuid") | ||
.inTable("startups") | ||
.onDelete("CASCADE"); | ||
} | ||
); | ||
}; | ||
|
||
exports.down = function (knex) { | ||
return knex.schema.dropTable("startup_aggregated_stats"); | ||
}; |
Oops, something went wrong.