-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
251 changed files
with
6,227 additions
and
1,985 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
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
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
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
8 changes: 8 additions & 0 deletions
8
back/db/migrate/20231031175023_create_dimension_user_custom_field_values.analytics.rb
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,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# This migration comes from analytics (originally 20231031174154) | ||
class CreateDimensionUserCustomFieldValues < ActiveRecord::Migration[7.0] | ||
def change | ||
create_view :analytics_dimension_user_custom_field_values | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
back/db/migrate/20231103094549_create_published_graph_data_units.rb
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,13 @@ | ||
class CreatePublishedGraphDataUnits < ActiveRecord::Migration[7.0] | ||
def change | ||
create_table :report_builder_published_graph_data_units, id: :uuid do |t| | ||
t.uuid :report_id, null: false, index: { name: :report_builder_published_data_units_report_id_idx } | ||
t.foreign_key :report_builder_reports, column: :report_id | ||
|
||
t.string :graph_id, null: false | ||
t.jsonb :data, null: false | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
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
23 changes: 23 additions & 0 deletions
23
back/db/views/analytics_dimension_user_custom_field_values_v01.sql
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,23 @@ | ||
SELECT | ||
u.id as dimension_user_id, | ||
cf.key, | ||
cf.value | ||
FROM | ||
users u | ||
LEFT JOIN LATERAL ( | ||
SELECT | ||
key, | ||
custom_field_values ->> key AS value | ||
FROM | ||
custom_fields | ||
where | ||
custom_fields.resource_type = 'User' | ||
) cf ON true | ||
LEFT JOIN LATERAL ( | ||
SELECT | ||
jsonb_object_keys(u.custom_field_values) AS key | ||
) cfv ON true | ||
GROUP BY | ||
dimension_user_id, | ||
cf.key, | ||
cf.value; |
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
Oops, something went wrong.