Identities
Here you can see your connected identities. You can add more or delete existing. Telegram identity is required to receive personal notifications from PullKeeper
diff --git a/app/views/controllers/web/repositories/index.html.erb b/app/views/controllers/web/repositories/index.html.erb
index da326573..1dc68bb4 100644
--- a/app/views/controllers/web/repositories/index.html.erb
+++ b/app/views/controllers/web/repositories/index.html.erb
@@ -5,7 +5,7 @@
<% if allowed_to?(:create_repository?, current_user) %>
<%=
js_component 'RepositoryNewModal',
- company_uuid: @company&.uuid,
+ company_id: @company&.id,
companies: @available_companies,
providers: Repository::LINK_FORMAT_BY_PROVIDER.keys.map { |key, _| [key, key.capitalize] }.to_h
%>
@@ -28,7 +28,7 @@
<% @repositories.each do |repository| %>
<%=
js_component 'Repository',
- uuid: repository.uuid,
+ id: repository.id,
avatar_url: repository.owner_avatar_url,
title: repository.title,
synced_at: repository.synced_at,
@@ -39,7 +39,7 @@
accessable: repository.accessable,
main_attribute: repository.current_config.main_attribute,
edit_links: allowed_to?(:update?, repository) ? {
- destroy: repository_path(repository.uuid)
+ destroy: repository_path(repository.id)
} : nil
%>
<% end %>
diff --git a/config/application.rb b/config/application.rb
index 50282d00..64eb5db0 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -54,6 +54,8 @@ class Application < Rails::Application
g.stylesheets false
g.javascripts false
g.helper false
+
+ g.orm :active_record, primary_key_type: :uuid
end
# allow encrypted and unencrypted data to co-exist
diff --git a/db/migrate/20241207181125_change_primary_keys.rb b/db/migrate/20241207181125_change_primary_keys.rb
new file mode 100644
index 00000000..22c8cf70
--- /dev/null
+++ b/db/migrate/20241207181125_change_primary_keys.rb
@@ -0,0 +1,308 @@
+class ChangePrimaryKeys < ActiveRecord::Migration[7.2]
+ disable_ddl_transaction!
+
+ def up
+ safety_assured do
+ remove_foreign_key :kudos_users_achievements, column: :user_id
+
+ rename_column :users, :id, :numeric_id
+ rename_column :users, :uuid, :id
+ change_pk(:users)
+ change_column_null :users, :numeric_id, true
+
+ # vacations
+ rename_column :vacations, :id, :numeric_id
+ rename_column :vacations, :uuid, :id
+ change_pk(:vacations)
+ change_column_null :vacations, :numeric_id, true
+
+ rename_column :vacations, :user_id, :numeric_user_id
+ add_column :vacations, :user_id, :uuid
+ add_index :vacations, :user_id, algorithm: :concurrently
+
+ # users_sessions
+ rename_column :users_sessions, :id, :numeric_id
+ rename_column :users_sessions, :uuid, :id
+ change_pk(:users_sessions)
+ change_column_null :users_sessions, :numeric_id, true
+
+ rename_column :users_sessions, :user_id, :numeric_user_id
+ add_column :users_sessions, :user_id, :uuid
+ add_index :users_sessions, :user_id, algorithm: :concurrently
+
+ # subscriptions
+ rename_column :subscriptions, :id, :numeric_id
+ rename_column :subscriptions, :uuid, :id
+ change_pk(:subscriptions)
+ change_column_null :subscriptions, :numeric_id, true
+
+ rename_column :subscriptions, :user_id, :numeric_user_id
+ add_column :subscriptions, :user_id, :uuid
+ add_index :subscriptions, :user_id, algorithm: :concurrently
+
+ # feedbacks
+ rename_column :feedbacks, :id, :numeric_id
+ rename_column :feedbacks, :uuid, :id
+ change_pk(:feedbacks)
+ change_column_null :feedbacks, :numeric_id, true
+
+ rename_column :feedbacks, :user_id, :numeric_user_id
+ add_column :feedbacks, :user_id, :uuid
+ add_index :feedbacks, :user_id, algorithm: :concurrently
+
+ # api_access_tokens
+ rename_column :api_access_tokens, :id, :numeric_id
+ rename_column :api_access_tokens, :uuid, :id
+ change_pk(:api_access_tokens)
+ change_column_null :api_access_tokens, :numeric_id, true
+
+ rename_column :api_access_tokens, :user_id, :numeric_user_id
+ add_column :api_access_tokens, :user_id, :uuid
+ add_index :api_access_tokens, :user_id, algorithm: :concurrently
+
+ # companies
+ rename_column :companies, :id, :numeric_id
+ rename_column :companies, :uuid, :id
+ change_pk(:companies)
+ change_column_null :companies, :numeric_id, true
+
+ rename_column :companies, :user_id, :numeric_user_id
+ add_column :companies, :user_id, :uuid
+ add_index :companies, :user_id, algorithm: :concurrently
+
+ # webhooks
+ rename_column :webhooks, :id, :numeric_id
+ rename_column :webhooks, :uuid, :id
+ change_pk(:webhooks)
+ change_column_null :webhooks, :numeric_id, true
+
+ rename_column :webhooks, :company_id, :numeric_company_id
+ add_column :webhooks, :company_id, :uuid
+ add_index :webhooks, [:company_id, :source, :url], unique: true, algorithm: :concurrently
+
+ # notifications
+ rename_column :notifications, :id, :numeric_id
+ rename_column :notifications, :uuid, :id
+ change_pk(:notifications)
+ change_column_null :notifications, :numeric_id, true
+
+ rename_column :notifications, :notifyable_id, :numeric_notifyable_id
+ add_column :notifications, :notifyable_id, :uuid
+ rename_column :notifications, :webhook_id, :numeric_webhook_id
+ add_column :notifications, :webhook_id, :uuid
+ add_index :notifications, [:webhook_id, :notification_type], unique: true, algorithm: :concurrently
+ add_index :notifications, [:notifyable_id, :notifyable_type], algorithm: :concurrently
+
+ # work_times
+ rename_column :work_times, :id, :numeric_id
+ rename_column :work_times, :uuid, :id
+ change_pk(:work_times)
+ change_column_null :work_times, :numeric_id, true
+
+ rename_column :work_times, :worktimeable_id, :numeric_worktimeable_id
+ add_column :work_times, :worktimeable_id, :uuid
+ add_index :work_times, [:worktimeable_id, :worktimeable_type], unique: true, algorithm: :concurrently
+
+ # invites
+ rename_column :invites, :id, :numeric_id
+ rename_column :invites, :uuid, :id
+ change_pk(:invites)
+ change_column_null :invites, :numeric_id, true
+
+ rename_column :invites, :inviteable_id, :numeric_inviteable_id
+ add_column :invites, :inviteable_id, :uuid
+ rename_column :invites, :receiver_id, :numeric_receiver_id
+ add_column :invites, :receiver_id, :uuid
+ add_index :invites, [:inviteable_id, :inviteable_type, :receiver_id], algorithm: :concurrently
+
+ # companies_users
+ rename_column :companies_users, :id, :numeric_id
+ rename_column :companies_users, :uuid, :id
+ change_pk(:companies_users)
+ change_column_null :companies_users, :numeric_id, true
+
+ rename_column :companies_users, :user_id, :numeric_user_id
+ add_column :companies_users, :user_id, :uuid
+ rename_column :companies_users, :company_id, :numeric_company_id
+ add_column :companies_users, :company_id, :uuid
+ rename_column :companies_users, :invite_id, :numeric_invite_id
+ add_column :companies_users, :invite_id, :uuid
+ add_index :companies_users, [:company_id, :user_id], unique: true, algorithm: :concurrently
+ add_index :companies_users, :invite_id, algorithm: :concurrently
+
+ # repositories
+ rename_column :repositories, :id, :numeric_id
+ rename_column :repositories, :uuid, :id
+ change_pk(:repositories)
+ change_column_null :repositories, :numeric_id, true
+
+ rename_column :repositories, :company_id, :numeric_company_id
+ add_column :repositories, :company_id, :uuid
+ add_index :repositories, :company_id, algorithm: :concurrently
+
+ # access_tokens
+ rename_column :access_tokens, :id, :numeric_id
+ rename_column :access_tokens, :uuid, :id
+ change_pk(:access_tokens)
+ change_column_null :access_tokens, :numeric_id, true
+
+ rename_column :access_tokens, :tokenable_id, :numeric_tokenable_id
+ add_column :access_tokens, :tokenable_id, :uuid
+ add_index :access_tokens, [:tokenable_id, :tokenable_type], unique: true, algorithm: :concurrently
+
+ # identities
+ rename_column :identities, :id, :numeric_id
+ rename_column :identities, :uuid, :id
+ change_pk(:identities)
+ change_column_null :identities, :numeric_id, true
+
+ rename_column :identities, :user_id, :numeric_user_id
+ add_column :identities, :user_id, :uuid
+ add_index :identities, :user_id, algorithm: :concurrently
+
+ # entities
+ rename_column :entities, :id, :numeric_id
+ rename_column :entities, :uuid, :id
+ change_pk(:entities)
+ change_column_null :entities, :numeric_id, true
+
+ rename_column :entities, :identity_id, :numeric_identity_id
+ add_column :entities, :identity_id, :uuid
+ add_index :entities, :identity_id, algorithm: :concurrently
+
+ # insights
+ rename_column :insights, :id, :numeric_id
+ rename_column :insights, :uuid, :id
+ change_pk(:insights)
+ change_column_null :insights, :numeric_id, true
+
+ rename_column :insights, :insightable_id, :numeric_insightable_id
+ add_column :insights, :insightable_id, :uuid
+ rename_column :insights, :entity_id, :numeric_entity_id
+ add_column :insights, :entity_id, :uuid
+ add_index :insights, [:insightable_id, :insightable_type], algorithm: :concurrently
+ add_index :insights, :entity_id, algorithm: :concurrently
+
+ # subscribers
+ rename_column :subscribers, :id, :numeric_id
+ rename_column :subscribers, :uuid, :id
+ change_pk(:subscribers)
+ change_column_null :subscribers, :numeric_id, true
+
+ # ignores
+ rename_column :ignores, :id, :numeric_id
+ rename_column :ignores, :uuid, :id
+ change_pk(:ignores)
+ change_column_null :ignores, :numeric_id, true
+
+ rename_column :ignores, :insightable_id, :numeric_insightable_id
+ add_column :ignores, :insightable_id, :uuid
+ add_index :ignores, [:insightable_id, :insightable_type, :entity_value], unique: true, algorithm: :concurrently
+
+ # excludes_groups
+ rename_column :excludes_groups, :id, :numeric_id
+ rename_column :excludes_groups, :uuid, :id
+ change_pk(:excludes_groups)
+ change_column_null :excludes_groups, :numeric_id, true
+
+ rename_column :excludes_groups, :insightable_id, :numeric_insightable_id
+ add_column :excludes_groups, :insightable_id, :uuid
+ add_index :excludes_groups, [:insightable_id, :insightable_type], algorithm: :concurrently
+
+ # excludes_rules
+ rename_column :excludes_rules, :id, :numeric_id
+ rename_column :excludes_rules, :uuid, :id
+ change_pk(:excludes_rules)
+ change_column_null :excludes_rules, :numeric_id, true
+
+ rename_column :excludes_rules, :excludes_group_id, :numeric_excludes_group_id
+ add_column :excludes_rules, :excludes_group_id, :uuid
+ add_index :excludes_rules, :excludes_group_id
+
+ # issues
+ rename_column :issues, :id, :numeric_id
+ rename_column :issues, :uuid, :id
+ change_pk(:issues)
+ change_column_null :issues, :numeric_id, true
+
+ rename_column :issues, :repository_id, :numeric_repository_id
+ add_column :issues, :repository_id, :uuid
+ add_index :issues, :repository_id
+
+ # issue_comments
+ rename_column :issue_comments, :id, :numeric_id
+ rename_column :issue_comments, :uuid, :id
+ change_pk(:issue_comments)
+ change_column_null :issue_comments, :numeric_id, true
+
+ rename_column :issue_comments, :issue_id, :numeric_issue_id
+ add_column :issue_comments, :issue_id, :uuid
+ add_index :issue_comments, :issue_id
+
+ # repositories_insights
+ rename_column :repositories_insights, :id, :numeric_id
+ rename_column :repositories_insights, :uuid, :id
+ change_pk(:repositories_insights)
+ change_column_null :repositories_insights, :numeric_id, true
+
+ rename_column :repositories_insights, :repository_id, :numeric_repository_id
+ add_column :repositories_insights, :repository_id, :uuid
+ add_index :repositories_insights, :repository_id
+
+ # pull_requests
+ rename_column :pull_requests, :id, :numeric_id
+ rename_column :pull_requests, :uuid, :id
+ change_pk(:pull_requests)
+ change_column_null :pull_requests, :numeric_id, true
+
+ rename_column :pull_requests, :repository_id, :numeric_repository_id
+ add_column :pull_requests, :repository_id, :uuid
+ rename_column :pull_requests, :entity_id, :numeric_entity_id
+ add_column :pull_requests, :entity_id, :uuid
+ add_index :pull_requests, :repository_id
+ add_index :pull_requests, :entity_id
+
+ # pull_requests_comments
+ rename_column :pull_requests_comments, :id, :numeric_id
+ rename_column :pull_requests_comments, :uuid, :id
+ change_pk(:pull_requests_comments)
+ change_column_null :pull_requests_comments, :numeric_id, true
+
+ rename_column :pull_requests_comments, :pull_request_id, :numeric_pull_request_id
+ add_column :pull_requests_comments, :pull_request_id, :uuid
+ rename_column :pull_requests_comments, :entity_id, :numeric_entity_id
+ add_column :pull_requests_comments, :entity_id, :uuid
+ add_index :pull_requests_comments, :pull_request_id
+ add_index :pull_requests_comments, :entity_id
+
+ # pull_requests_reviews
+ rename_column :pull_requests_reviews, :id, :numeric_id
+ rename_column :pull_requests_reviews, :uuid, :id
+ change_pk(:pull_requests_reviews)
+ change_column_null :pull_requests_reviews, :numeric_id, true
+
+ rename_column :pull_requests_reviews, :pull_request_id, :numeric_pull_request_id
+ add_column :pull_requests_reviews, :pull_request_id, :uuid
+ rename_column :pull_requests_reviews, :entity_id, :numeric_entity_id
+ add_column :pull_requests_reviews, :entity_id, :uuid
+ add_index :pull_requests_reviews, :pull_request_id
+ add_index :pull_requests_reviews, :entity_id
+
+ # kudos_users_achievements
+ rename_column :kudos_users_achievements, :user_id, :numeric_user_id
+ add_column :kudos_users_achievements, :user_id, :uuid
+ add_index :kudos_users_achievements, :user_id
+ end
+ end
+
+ def down; end
+
+ def change_pk(table)
+ execute "ALTER TABLE #{table} DROP CONSTRAINT #{table}_pkey;"
+ execute "ALTER TABLE #{table} ADD PRIMARY KEY (id);"
+ execute "ALTER TABLE ONLY #{table} ALTER COLUMN numeric_id DROP DEFAULT;"
+ execute "DROP SEQUENCE IF EXISTS #{table}_id_seq"
+
+ change_column_null table, :numeric_id, true
+ end
+end
diff --git a/db/migrate/20241207182227_backfill_data.rb b/db/migrate/20241207182227_backfill_data.rb
new file mode 100644
index 00000000..1f83d59c
--- /dev/null
+++ b/db/migrate/20241207182227_backfill_data.rb
@@ -0,0 +1,218 @@
+class BackfillData < ActiveRecord::Migration[7.2]
+ disable_ddl_transaction!
+
+ def up
+ User::Vacation.find_each do |item|
+ item.update!(user_id: User.find_by(numeric_id: item.numeric_user_id).id)
+ end
+
+ User::Session.find_each do |item|
+ item.update!(user_id: User.find_by(numeric_id: item.numeric_user_id).id)
+ end
+
+ User::Subscription.find_each do |item|
+ item.update!(user_id: User.find_by(numeric_id: item.numeric_user_id).id)
+ end
+
+ User::Feedback.find_each do |item|
+ item.update!(user_id: User.find_by(numeric_id: item.numeric_user_id).id)
+ end
+
+ ApiAccessToken.find_each do |item|
+ item.update!(user_id: User.find_by(numeric_id: item.numeric_user_id).id)
+ end
+
+ Company.find_each do |item|
+ item.update!(user_id: User.find_by(numeric_id: item.numeric_user_id).id)
+ end
+
+ Webhook.find_each do |item|
+ item.update!(company_id: Company.find_by(numeric_id: item.numeric_company_id).id)
+ end
+
+ Notification.find_each do |item|
+ item.update!(
+ notifyable_id: item.notifyable_type.constantize.find_by(numeric_id: item.numeric_notifyable_id).id,
+ webhook_id: Webhook.find_by(numeric_id: item.numeric_webhook_id).id
+ )
+ end
+
+ WorkTime.find_each do |item|
+ item.update!(
+ worktimeable_id: item.worktimeable_type.constantize.find_by(numeric_id: item.numeric_worktimeable_id).id
+ )
+ end
+
+ Invite.find_each do |item|
+ item.update!(
+ inviteable_id: item.inviteable_type.constantize.find_by(numeric_id: item.numeric_inviteable_id).id,
+ receiver_id: User.find_by(numeric_id: item.numeric_receiver_id)&.id
+ )
+ end
+
+ Companies::User.find_each do |item|
+ item.update!(
+ company_id: Company.find_by(numeric_id: item.numeric_company_id).id,
+ user_id: User.find_by(numeric_id: item.numeric_user_id).id,
+ invite_id: Invite.find_by(numeric_id: item.numeric_invite_id).id
+ )
+ end
+
+ Repository.find_each do |item|
+ item.update!(company_id: Company.find_by(numeric_id: item.numeric_company_id).id)
+ end
+
+ AccessToken.find_each do |item|
+ item.update!(
+ tokenable_id: item.tokenable_type.constantize.find_by(numeric_id: item.numeric_tokenable_id).id
+ )
+ end
+
+ Identity.find_each do |item|
+ item.update!(user_id: User.find_by(numeric_id: item.numeric_user_id).id)
+ end
+
+ Entity.find_each do |item|
+ item.update!(identity_id: User.find_by(numeric_id: item.numeric_identity_id)&.id)
+ end
+
+ Insight.find_each do |item|
+ insightable = item.insightable_type.constantize.find_by(numeric_id: item.numeric_insightable_id)
+ next if insightable.nil?
+
+ item.update!(
+ insightable_id: insightable.id,
+ entity_id: Entity.find_by(numeric_id: item.numeric_entity_id).id
+ )
+ end
+
+ Entity::Ignore.find_each do |item|
+ item.update!(
+ insightable_id: item.insightable_type.constantize.find_by(numeric_id: item.numeric_insightable_id).id
+ )
+ end
+
+ Excludes::Group.find_each do |item|
+ item.update!(
+ insightable_id: item.insightable_type.constantize.find_by(numeric_id: item.numeric_insightable_id).id
+ )
+ end
+
+ Excludes::Rule.find_each do |item|
+ item.update!(excludes_group_id: Excludes::Group.find_by(numeric_id: item.numeric_excludes_group_id).id)
+ end
+
+ Issue.find_each do |item|
+ item.update!(repository_id: Repository.find_by(numeric_id: item.numeric_repository_id).id)
+ end
+
+ Issue::Comment.find_each do |item|
+ item.update!(issue_id: Issue.find_by(numeric_id: item.numeric_issue_id).id)
+ end
+
+ Repositories::Insight.find_each do |item|
+ item.update!(repository_id: Repository.find_by(numeric_id: item.numeric_repository_id).id)
+ end
+
+ PullRequest.find_each do |item|
+ item.update!(
+ repository_id: Repository.find_by(numeric_id: item.numeric_repository_id).id,
+ entity_id: Entity.find_by(numeric_id: item.numeric_entity_id).id
+ )
+ end
+
+ PullRequest::Comment.find_each do |item|
+ item.update!(
+ pull_request_id: PullRequest.find_by(numeric_id: item.numeric_pull_request_id).id,
+ entity_id: Entity.find_by(numeric_id: item.numeric_entity_id).id
+ )
+ end
+
+ PullRequest::Review.find_each do |item|
+ item.update!(
+ pull_request_id: PullRequest.find_by(numeric_id: item.numeric_pull_request_id).id,
+ entity_id: Entity.find_by(numeric_id: item.numeric_entity_id).id
+ )
+ end
+
+ Kudos::Users::Achievement.find_each do |item|
+ item.update!(user_id: User.find_by(numeric_id: item.numeric_user_id).id)
+ end
+
+ Insight.where(insightable_id: nil).destroy_all
+
+ safety_assured do
+ change_column_null :vacations, :user_id, false
+ change_column_null :users_sessions, :user_id, false
+ change_column_null :subscriptions, :user_id, false
+ change_column_null :feedbacks, :user_id, false
+ change_column_null :api_access_tokens, :user_id, false
+ change_column_null :companies, :user_id, false
+ change_column_null :companies_users, :company_id, false
+ change_column_null :companies_users, :user_id, false
+ change_column_null :companies_users, :invite_id, false
+ change_column_null :webhooks, :company_id, false
+ change_column_null :notifications, :notifyable_id, false
+ change_column_null :notifications, :webhook_id, false
+ change_column_null :work_times, :worktimeable_id, false
+ change_column_null :invites, :inviteable_id, false
+ change_column_null :repositories, :company_id, false
+ change_column_null :access_tokens, :tokenable_id, false
+ change_column_null :identities, :user_id, false
+ change_column_null :insights, :insightable_id, false
+ change_column_null :insights, :entity_id, false
+ change_column_null :ignores, :insightable_id, false
+ change_column_null :excludes_groups, :insightable_id, false
+ change_column_null :excludes_rules, :excludes_group_id, false
+ change_column_null :issues, :repository_id, false
+ change_column_null :issue_comments, :issue_id, false
+ change_column_null :repositories_insights, :repository_id, false
+ change_column_null :pull_requests, :repository_id, false
+ change_column_null :pull_requests, :entity_id, false
+ change_column_null :pull_requests_comments, :pull_request_id, false
+ change_column_null :pull_requests_comments, :entity_id, false
+ change_column_null :pull_requests_reviews, :pull_request_id, false
+ change_column_null :pull_requests_reviews, :entity_id, false
+ change_column_null :kudos_users_achievements, :user_id, false
+
+ change_column_null :vacations, :numeric_user_id, true
+ change_column_null :users_sessions, :numeric_user_id, true
+ change_column_null :subscriptions, :numeric_user_id, true
+ change_column_null :feedbacks, :numeric_user_id, true
+ change_column_null :api_access_tokens, :numeric_user_id, true
+ change_column_null :companies, :numeric_user_id, true
+ change_column_null :companies_users, :numeric_company_id, true
+ change_column_null :companies_users, :numeric_user_id, true
+ change_column_null :companies_users, :numeric_invite_id, true
+ change_column_null :webhooks, :numeric_company_id, true
+ change_column_null :notifications, :numeric_notifyable_id, true
+ change_column_null :notifications, :numeric_webhook_id, true
+ change_column_null :work_times, :numeric_worktimeable_id, true
+ change_column_null :invites, :numeric_inviteable_id, true
+ change_column_null :repositories, :numeric_company_id, true
+ change_column_null :access_tokens, :numeric_tokenable_id, true
+ change_column_null :identities, :numeric_user_id, true
+ change_column_null :insights, :numeric_insightable_id, true
+ change_column_null :insights, :numeric_entity_id, true
+ change_column_null :ignores, :numeric_insightable_id, true
+ change_column_null :excludes_groups, :numeric_insightable_id, true
+ change_column_null :excludes_rules, :numeric_excludes_group_id, true
+ change_column_null :issues, :numeric_repository_id, true
+ change_column_null :issue_comments, :numeric_issue_id, true
+ change_column_null :repositories_insights, :numeric_repository_id, true
+ change_column_null :pull_requests, :numeric_repository_id, true
+ change_column_null :pull_requests, :numeric_entity_id, true
+ change_column_null :pull_requests_comments, :numeric_pull_request_id, true
+ change_column_null :pull_requests_comments, :numeric_entity_id, true
+ change_column_null :pull_requests_reviews, :numeric_pull_request_id, true
+ change_column_null :pull_requests_reviews, :numeric_entity_id, true
+ change_column_null :kudos_users_achievements, :numeric_user_id, true
+ end
+
+ Company.find_each do |company|
+ Company.reset_counters company.id, :repositories_count
+ end
+ end
+
+ def down; end
+end
diff --git a/db/structure.sql b/db/structure.sql
index 33f6b341..83abfee3 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -1,6 +1,7 @@
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
+SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
@@ -267,69 +268,33 @@ $$;
--
CREATE TABLE public.access_tokens (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- tokenable_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_tokenable_id bigint,
tokenable_type character varying NOT NULL,
value text NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
- expired_at timestamp(6) without time zone
+ expired_at timestamp(6) without time zone,
+ tokenable_id uuid NOT NULL
);
---
--- Name: access_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.access_tokens_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: access_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.access_tokens_id_seq OWNED BY public.access_tokens.id;
-
-
--
-- Name: api_access_tokens; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.api_access_tokens (
- id bigint NOT NULL,
- user_id bigint NOT NULL,
+ numeric_id bigint,
+ numeric_user_id bigint,
value text NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ user_id uuid NOT NULL
);
---
--- Name: api_access_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.api_access_tokens_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: api_access_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.api_access_tokens_id_seq OWNED BY public.api_access_tokens.id;
-
-
--
-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
--
@@ -347,9 +312,9 @@ CREATE TABLE public.ar_internal_metadata (
--
CREATE TABLE public.companies (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- user_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_user_id bigint,
title character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
@@ -357,64 +322,30 @@ CREATE TABLE public.companies (
configuration jsonb DEFAULT '{}'::jsonb NOT NULL,
accessable boolean DEFAULT true NOT NULL,
not_accessable_ticks integer DEFAULT 0 NOT NULL,
- config jsonb DEFAULT '{}'::jsonb NOT NULL
+ config jsonb DEFAULT '{}'::jsonb NOT NULL,
+ user_id uuid NOT NULL
);
---
--- Name: companies_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.companies_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: companies_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.companies_id_seq OWNED BY public.companies.id;
-
-
--
-- Name: companies_users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.companies_users (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- company_id bigint NOT NULL,
- user_id bigint NOT NULL,
- invite_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_company_id bigint,
+ numeric_user_id bigint,
+ numeric_invite_id bigint,
access integer DEFAULT 0 NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
+ updated_at timestamp(6) without time zone NOT NULL,
+ user_id uuid NOT NULL,
+ company_id uuid NOT NULL,
+ invite_id uuid NOT NULL
);
---
--- Name: companies_users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.companies_users_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: companies_users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.companies_users_id_seq OWNED BY public.companies_users.id;
-
-
--
-- Name: emailbutler_messages; Type: TABLE; Schema: public; Owner: -
--
@@ -458,38 +389,20 @@ ALTER SEQUENCE public.emailbutler_messages_id_seq OWNED BY public.emailbutler_me
--
CREATE TABLE public.entities (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
external_id character varying NOT NULL,
provider integer DEFAULT 0 NOT NULL,
login character varying,
avatar_url character varying,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
- identity_id bigint,
- html_url character varying
+ numeric_identity_id bigint,
+ html_url character varying,
+ identity_id uuid
);
---
--- Name: entities_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.entities_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: entities_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.entities_id_seq OWNED BY public.entities.id;
-
-
--
-- Name: event_store_events; Type: TABLE; Schema: public; Owner: -
--
@@ -561,47 +474,30 @@ ALTER SEQUENCE public.event_store_events_in_streams_id_seq OWNED BY public.event
--
CREATE TABLE public.excludes_groups (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- insightable_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_insightable_id bigint,
insightable_type character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
+ updated_at timestamp(6) without time zone NOT NULL,
+ insightable_id uuid NOT NULL
);
---
--- Name: excludes_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.excludes_groups_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: excludes_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.excludes_groups_id_seq OWNED BY public.excludes_groups.id;
-
-
--
-- Name: excludes_rules; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.excludes_rules (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- excludes_group_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_excludes_group_id bigint,
target integer NOT NULL,
condition integer NOT NULL,
value character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
+ updated_at timestamp(6) without time zone NOT NULL,
+ excludes_group_id uuid NOT NULL
);
@@ -626,140 +522,67 @@ COMMENT ON COLUMN public.excludes_rules.condition IS 'Condition for exclude rule
COMMENT ON COLUMN public.excludes_rules.value IS 'Value for comparison';
---
--- Name: excludes_rules_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.excludes_rules_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: excludes_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.excludes_rules_id_seq OWNED BY public.excludes_rules.id;
-
-
--
-- Name: feedbacks; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.feedbacks (
- id bigint NOT NULL,
- user_id bigint NOT NULL,
+ numeric_id bigint,
+ numeric_user_id bigint,
title character varying,
description text NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
email text,
answerable boolean DEFAULT false NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ user_id uuid NOT NULL
);
---
--- Name: feedbacks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.feedbacks_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: feedbacks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.feedbacks_id_seq OWNED BY public.feedbacks.id;
-
-
--
-- Name: identities; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.identities (
- id bigint NOT NULL,
- user_id bigint NOT NULL,
+ numeric_id bigint,
+ numeric_user_id bigint,
uid character varying NOT NULL,
provider integer DEFAULT 0 NOT NULL,
email text,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
login character varying,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ user_id uuid NOT NULL
);
---
--- Name: identities_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.identities_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: identities_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.identities_id_seq OWNED BY public.identities.id;
-
-
--
-- Name: ignores; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.ignores (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- insightable_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_insightable_id bigint,
insightable_type character varying NOT NULL,
entity_value character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
+ updated_at timestamp(6) without time zone NOT NULL,
+ insightable_id uuid NOT NULL
);
---
--- Name: ignores_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.ignores_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: ignores_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.ignores_id_seq OWNED BY public.ignores.id;
-
-
--
-- Name: insights; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.insights (
- id bigint NOT NULL,
- insightable_id bigint NOT NULL,
+ numeric_id bigint,
+ numeric_insightable_id bigint,
insightable_type character varying NOT NULL,
- entity_id bigint NOT NULL,
+ numeric_entity_id bigint,
comments_count integer DEFAULT 0,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
@@ -779,7 +602,9 @@ CREATE TABLE public.insights (
bad_reviews_count integer DEFAULT 0 NOT NULL,
conventional_comments_count integer DEFAULT 0,
time_since_last_open_pull_seconds integer DEFAULT 0,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ insightable_id uuid NOT NULL,
+ entity_id uuid NOT NULL
);
@@ -797,74 +622,39 @@ COMMENT ON COLUMN public.insights.hidden IS 'Flag for hiding insights, if true -
COMMENT ON COLUMN public.insights.time_since_last_open_pull_seconds IS 'Time since last open pull request';
---
--- Name: insights_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.insights_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: insights_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.insights_id_seq OWNED BY public.insights.id;
-
-
--
-- Name: invites; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.invites (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- inviteable_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_inviteable_id bigint,
inviteable_type character varying NOT NULL,
- receiver_id bigint,
+ numeric_receiver_id bigint,
email text,
code character varying,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
- access integer DEFAULT 0 NOT NULL
+ access integer DEFAULT 0 NOT NULL,
+ inviteable_id uuid NOT NULL,
+ receiver_id uuid
);
---
--- Name: invites_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.invites_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: invites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.invites_id_seq OWNED BY public.invites.id;
-
-
--
-- Name: issue_comments; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.issue_comments (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- issue_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_issue_id bigint,
external_id character varying NOT NULL,
comment_created_at timestamp(6) without time zone,
created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
+ updated_at timestamp(6) without time zone NOT NULL,
+ issue_id uuid NOT NULL
);
@@ -882,60 +672,23 @@ COMMENT ON TABLE public.issue_comments IS 'Comments of issue';
COMMENT ON COLUMN public.issue_comments.comment_created_at IS 'Time of creating comment in issue';
---
--- Name: issue_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.issue_comments_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: issue_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.issue_comments_id_seq OWNED BY public.issue_comments.id;
-
-
--
-- Name: issues; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.issues (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- repository_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_repository_id bigint,
opened_at timestamp(6) without time zone,
closed_at timestamp(6) without time zone,
issue_number integer,
created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
+ updated_at timestamp(6) without time zone NOT NULL,
+ repository_id uuid NOT NULL
);
---
--- Name: issues_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.issues_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: issues_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.issues_id_seq OWNED BY public.issues.id;
-
-
--
-- Name: kudos_achievement_groups; Type: TABLE; Schema: public; Owner: -
--
@@ -1013,7 +766,7 @@ ALTER SEQUENCE public.kudos_achievements_id_seq OWNED BY public.kudos_achievemen
CREATE TABLE public.kudos_users_achievements (
id bigint NOT NULL,
- user_id bigint NOT NULL,
+ numeric_user_id bigint,
kudos_achievement_id bigint NOT NULL,
notified boolean DEFAULT false NOT NULL,
rank integer,
@@ -1021,7 +774,8 @@ CREATE TABLE public.kudos_users_achievements (
title jsonb DEFAULT '{}'::jsonb NOT NULL,
description jsonb DEFAULT '{}'::jsonb NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
+ updated_at timestamp(6) without time zone NOT NULL,
+ user_id uuid NOT NULL
);
@@ -1049,54 +803,39 @@ ALTER SEQUENCE public.kudos_users_achievements_id_seq OWNED BY public.kudos_user
--
CREATE TABLE public.notifications (
- id bigint NOT NULL,
- notifyable_id bigint NOT NULL,
+ numeric_id bigint,
+ numeric_notifyable_id bigint,
notifyable_type character varying NOT NULL,
notification_type integer NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- webhook_id bigint NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_webhook_id bigint,
+ notifyable_id uuid NOT NULL,
+ webhook_id uuid NOT NULL
);
--
--- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.notifications_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id;
-
-
---
--- Name: pull_requests; Type: TABLE; Schema: public; Owner: -
+-- Name: pull_requests; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.pull_requests (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- repository_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_repository_id bigint,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
pull_number integer NOT NULL,
pull_created_at timestamp(6) without time zone,
pull_closed_at timestamp(6) without time zone,
pull_merged_at timestamp(6) without time zone,
- entity_id bigint NOT NULL,
+ numeric_entity_id bigint,
pull_requests_comments_count integer DEFAULT 0 NOT NULL,
changed_loc integer DEFAULT 0 NOT NULL,
- last_commit_external_id character varying
+ last_commit_external_id character varying,
+ repository_id uuid NOT NULL,
+ entity_id uuid NOT NULL
);
@@ -1112,94 +851,41 @@ COMMENT ON COLUMN public.pull_requests.changed_loc IS 'Lines Of Code changed in
--
CREATE TABLE public.pull_requests_comments (
- id bigint NOT NULL,
+ numeric_id bigint,
external_id character varying NOT NULL,
comment_created_at timestamp(6) without time zone NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
- pull_request_id bigint NOT NULL,
- entity_id bigint NOT NULL,
+ numeric_pull_request_id bigint,
+ numeric_entity_id bigint,
parsed_body jsonb,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ pull_request_id uuid NOT NULL,
+ entity_id uuid NOT NULL
);
---
--- Name: pull_requests_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.pull_requests_comments_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: pull_requests_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.pull_requests_comments_id_seq OWNED BY public.pull_requests_comments.id;
-
-
---
--- Name: pull_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.pull_requests_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: pull_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.pull_requests_id_seq OWNED BY public.pull_requests.id;
-
-
--
-- Name: pull_requests_reviews; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.pull_requests_reviews (
- id bigint NOT NULL,
+ numeric_id bigint,
external_id character varying,
review_created_at timestamp(6) without time zone,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
- pull_request_id bigint NOT NULL,
- entity_id bigint NOT NULL,
+ numeric_pull_request_id bigint,
+ numeric_entity_id bigint,
required boolean DEFAULT false NOT NULL,
state integer DEFAULT 0 NOT NULL,
commit_external_id character varying,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ pull_request_id uuid NOT NULL,
+ entity_id uuid NOT NULL
);
---
--- Name: pull_requests_reviews_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.pull_requests_reviews_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: pull_requests_reviews_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.pull_requests_reviews_id_seq OWNED BY public.pull_requests_reviews.id;
-
-
--
-- Name: que_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
@@ -1254,9 +940,9 @@ WITH (fillfactor='90');
--
CREATE TABLE public.repositories (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- company_id bigint NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_company_id bigint,
title character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
@@ -1266,36 +952,18 @@ CREATE TABLE public.repositories (
external_id character varying,
synced_at timestamp(6) without time zone,
accessable boolean DEFAULT true NOT NULL,
- owner_avatar_url character varying
+ owner_avatar_url character varying,
+ company_id uuid NOT NULL
);
---
--- Name: repositories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.repositories_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: repositories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.repositories_id_seq OWNED BY public.repositories.id;
-
-
--
-- Name: repositories_insights; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.repositories_insights (
- id bigint NOT NULL,
- repository_id bigint NOT NULL,
+ numeric_id bigint,
+ numeric_repository_id bigint,
previous_date character varying,
open_pull_requests_count integer DEFAULT 0 NOT NULL,
commented_pull_requests_count integer DEFAULT 0 NOT NULL,
@@ -1315,7 +983,8 @@ CREATE TABLE public.repositories_insights (
closed_issues_count integer DEFAULT 0 NOT NULL,
average_issue_comment_time integer DEFAULT 0 NOT NULL,
average_issue_close_time integer DEFAULT 0 NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ repository_id uuid NOT NULL
);
@@ -1347,25 +1016,6 @@ COMMENT ON COLUMN public.repositories_insights.average_issue_comment_time IS 'Av
COMMENT ON COLUMN public.repositories_insights.average_issue_close_time IS 'Average time until closing issue';
---
--- Name: repositories_insights_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.repositories_insights_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: repositories_insights_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.repositories_insights_id_seq OWNED BY public.repositories_insights.id;
-
-
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
@@ -1380,48 +1030,30 @@ CREATE TABLE public.schema_migrations (
--
CREATE TABLE public.subscribers (
- id bigint NOT NULL,
+ numeric_id bigint,
email text NOT NULL,
unsubscribe_token character varying,
unsubscribed_at timestamp(6) without time zone,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL
);
---
--- Name: subscribers_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.subscribers_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: subscribers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.subscribers_id_seq OWNED BY public.subscribers.id;
-
-
--
-- Name: subscriptions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subscriptions (
- id bigint NOT NULL,
- user_id bigint NOT NULL,
+ numeric_id bigint,
+ numeric_user_id bigint,
start_time timestamp(6) without time zone NOT NULL,
end_time timestamp(6) without time zone NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
external_invoice_id character varying,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ user_id uuid NOT NULL
);
@@ -1432,436 +1064,137 @@ CREATE TABLE public.subscriptions (
COMMENT ON COLUMN public.subscriptions.external_invoice_id IS 'Invoice ID from external system';
---
--- Name: subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.subscriptions_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.subscriptions_id_seq OWNED BY public.subscriptions.id;
-
-
--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.users (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
email text DEFAULT ''::character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
role integer DEFAULT 0 NOT NULL,
work_start_time time without time zone,
- work_end_time time without time zone,
- work_time_zone character varying,
- start_time character varying,
- end_time character varying,
- time_zone character varying
-);
-
-
---
--- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.users_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
-
-
---
--- Name: users_sessions; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.users_sessions (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- user_id bigint NOT NULL,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL
-);
-
-
---
--- Name: users_sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.users_sessions_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: users_sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.users_sessions_id_seq OWNED BY public.users_sessions.id;
-
-
---
--- Name: vacations; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.vacations (
- id bigint NOT NULL,
- user_id bigint NOT NULL,
- start_time timestamp(6) without time zone NOT NULL,
- end_time timestamp(6) without time zone NOT NULL,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
-);
-
-
---
--- Name: vacations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.vacations_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: vacations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.vacations_id_seq OWNED BY public.vacations.id;
-
-
---
--- Name: webhooks; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.webhooks (
- id bigint NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL,
- source integer DEFAULT 0 NOT NULL,
- url character varying NOT NULL,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL,
- company_id bigint NOT NULL
-);
-
-
---
--- Name: webhooks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.webhooks_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: webhooks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.webhooks_id_seq OWNED BY public.webhooks.id;
-
-
---
--- Name: work_times; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.work_times (
- id bigint NOT NULL,
- worktimeable_id bigint NOT NULL,
- worktimeable_type character varying NOT NULL,
- starts_at character varying NOT NULL,
- ends_at character varying NOT NULL,
- timezone character varying DEFAULT '0'::character varying NOT NULL,
- created_at timestamp(6) without time zone NOT NULL,
- updated_at timestamp(6) without time zone NOT NULL,
- uuid uuid DEFAULT gen_random_uuid() NOT NULL
-);
-
-
---
--- Name: work_times_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.work_times_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
---
--- Name: work_times_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.work_times_id_seq OWNED BY public.work_times.id;
-
-
---
--- Name: access_tokens id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.access_tokens ALTER COLUMN id SET DEFAULT nextval('public.access_tokens_id_seq'::regclass);
-
-
---
--- Name: api_access_tokens id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.api_access_tokens ALTER COLUMN id SET DEFAULT nextval('public.api_access_tokens_id_seq'::regclass);
-
-
---
--- Name: companies id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.companies ALTER COLUMN id SET DEFAULT nextval('public.companies_id_seq'::regclass);
-
-
---
--- Name: companies_users id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.companies_users ALTER COLUMN id SET DEFAULT nextval('public.companies_users_id_seq'::regclass);
-
-
---
--- Name: emailbutler_messages id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.emailbutler_messages ALTER COLUMN id SET DEFAULT nextval('public.emailbutler_messages_id_seq'::regclass);
-
-
---
--- Name: entities id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.entities ALTER COLUMN id SET DEFAULT nextval('public.entities_id_seq'::regclass);
-
-
---
--- Name: event_store_events id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.event_store_events ALTER COLUMN id SET DEFAULT nextval('public.event_store_events_id_seq'::regclass);
-
-
---
--- Name: event_store_events_in_streams id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.event_store_events_in_streams ALTER COLUMN id SET DEFAULT nextval('public.event_store_events_in_streams_id_seq'::regclass);
-
-
---
--- Name: excludes_groups id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.excludes_groups ALTER COLUMN id SET DEFAULT nextval('public.excludes_groups_id_seq'::regclass);
-
-
---
--- Name: excludes_rules id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.excludes_rules ALTER COLUMN id SET DEFAULT nextval('public.excludes_rules_id_seq'::regclass);
-
-
---
--- Name: feedbacks id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.feedbacks ALTER COLUMN id SET DEFAULT nextval('public.feedbacks_id_seq'::regclass);
-
-
---
--- Name: identities id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.identities ALTER COLUMN id SET DEFAULT nextval('public.identities_id_seq'::regclass);
-
-
---
--- Name: ignores id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.ignores ALTER COLUMN id SET DEFAULT nextval('public.ignores_id_seq'::regclass);
-
-
---
--- Name: insights id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.insights ALTER COLUMN id SET DEFAULT nextval('public.insights_id_seq'::regclass);
-
-
---
--- Name: invites id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.invites ALTER COLUMN id SET DEFAULT nextval('public.invites_id_seq'::regclass);
-
-
---
--- Name: issue_comments id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.issue_comments ALTER COLUMN id SET DEFAULT nextval('public.issue_comments_id_seq'::regclass);
-
-
---
--- Name: issues id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.issues ALTER COLUMN id SET DEFAULT nextval('public.issues_id_seq'::regclass);
-
-
---
--- Name: kudos_achievement_groups id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.kudos_achievement_groups ALTER COLUMN id SET DEFAULT nextval('public.kudos_achievement_groups_id_seq'::regclass);
-
-
---
--- Name: kudos_achievements id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.kudos_achievements ALTER COLUMN id SET DEFAULT nextval('public.kudos_achievements_id_seq'::regclass);
-
-
---
--- Name: kudos_users_achievements id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.kudos_users_achievements ALTER COLUMN id SET DEFAULT nextval('public.kudos_users_achievements_id_seq'::regclass);
-
-
---
--- Name: notifications id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass);
-
-
---
--- Name: pull_requests id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.pull_requests ALTER COLUMN id SET DEFAULT nextval('public.pull_requests_id_seq'::regclass);
-
-
---
--- Name: pull_requests_comments id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.pull_requests_comments ALTER COLUMN id SET DEFAULT nextval('public.pull_requests_comments_id_seq'::regclass);
+ work_end_time time without time zone,
+ work_time_zone character varying,
+ start_time character varying,
+ end_time character varying,
+ time_zone character varying
+);
--
--- Name: pull_requests_reviews id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: users_sessions; Type: TABLE; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.pull_requests_reviews ALTER COLUMN id SET DEFAULT nextval('public.pull_requests_reviews_id_seq'::regclass);
+CREATE TABLE public.users_sessions (
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ numeric_user_id bigint,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL,
+ user_id uuid NOT NULL
+);
--
--- Name: que_jobs id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: vacations; Type: TABLE; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.que_jobs ALTER COLUMN id SET DEFAULT nextval('public.que_jobs_id_seq'::regclass);
+CREATE TABLE public.vacations (
+ numeric_id bigint,
+ numeric_user_id bigint,
+ start_time timestamp(6) without time zone NOT NULL,
+ end_time timestamp(6) without time zone NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ user_id uuid NOT NULL
+);
--
--- Name: repositories id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: webhooks; Type: TABLE; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.repositories ALTER COLUMN id SET DEFAULT nextval('public.repositories_id_seq'::regclass);
+CREATE TABLE public.webhooks (
+ numeric_id bigint,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ source integer DEFAULT 0 NOT NULL,
+ url character varying NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL,
+ numeric_company_id bigint,
+ company_id uuid NOT NULL
+);
--
--- Name: repositories_insights id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: work_times; Type: TABLE; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.repositories_insights ALTER COLUMN id SET DEFAULT nextval('public.repositories_insights_id_seq'::regclass);
+CREATE TABLE public.work_times (
+ numeric_id bigint,
+ numeric_worktimeable_id bigint,
+ worktimeable_type character varying NOT NULL,
+ starts_at character varying NOT NULL,
+ ends_at character varying NOT NULL,
+ timezone character varying DEFAULT '0'::character varying NOT NULL,
+ created_at timestamp(6) without time zone NOT NULL,
+ updated_at timestamp(6) without time zone NOT NULL,
+ id uuid DEFAULT gen_random_uuid() NOT NULL,
+ worktimeable_id uuid NOT NULL
+);
--
--- Name: subscribers id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: emailbutler_messages id; Type: DEFAULT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.subscribers ALTER COLUMN id SET DEFAULT nextval('public.subscribers_id_seq'::regclass);
+ALTER TABLE ONLY public.emailbutler_messages ALTER COLUMN id SET DEFAULT nextval('public.emailbutler_messages_id_seq'::regclass);
--
--- Name: subscriptions id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: event_store_events id; Type: DEFAULT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.subscriptions ALTER COLUMN id SET DEFAULT nextval('public.subscriptions_id_seq'::regclass);
+ALTER TABLE ONLY public.event_store_events ALTER COLUMN id SET DEFAULT nextval('public.event_store_events_id_seq'::regclass);
--
--- Name: users id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: event_store_events_in_streams id; Type: DEFAULT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
+ALTER TABLE ONLY public.event_store_events_in_streams ALTER COLUMN id SET DEFAULT nextval('public.event_store_events_in_streams_id_seq'::regclass);
--
--- Name: users_sessions id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: kudos_achievement_groups id; Type: DEFAULT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.users_sessions ALTER COLUMN id SET DEFAULT nextval('public.users_sessions_id_seq'::regclass);
+ALTER TABLE ONLY public.kudos_achievement_groups ALTER COLUMN id SET DEFAULT nextval('public.kudos_achievement_groups_id_seq'::regclass);
--
--- Name: vacations id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: kudos_achievements id; Type: DEFAULT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.vacations ALTER COLUMN id SET DEFAULT nextval('public.vacations_id_seq'::regclass);
+ALTER TABLE ONLY public.kudos_achievements ALTER COLUMN id SET DEFAULT nextval('public.kudos_achievements_id_seq'::regclass);
--
--- Name: webhooks id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: kudos_users_achievements id; Type: DEFAULT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.webhooks ALTER COLUMN id SET DEFAULT nextval('public.webhooks_id_seq'::regclass);
+ALTER TABLE ONLY public.kudos_users_achievements ALTER COLUMN id SET DEFAULT nextval('public.kudos_users_achievements_id_seq'::regclass);
--
--- Name: work_times id; Type: DEFAULT; Schema: public; Owner: -
+-- Name: que_jobs id; Type: DEFAULT; Schema: public; Owner: -
--
-ALTER TABLE ONLY public.work_times ALTER COLUMN id SET DEFAULT nextval('public.work_times_id_seq'::regclass);
+ALTER TABLE ONLY public.que_jobs ALTER COLUMN id SET DEFAULT nextval('public.que_jobs_id_seq'::regclass);
--
@@ -2182,6 +1515,69 @@ CREATE UNIQUE INDEX idx_on_insightable_id_insightable_type_entity_value_508616f2
CREATE INDEX idx_on_inviteable_id_inviteable_type_receiver_id_700d475c99 ON public.invites USING btree (inviteable_id, inviteable_type, receiver_id);
+--
+-- Name: idx_on_numeric_company_id_numeric_user_id_7ddb80d90a; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX idx_on_numeric_company_id_numeric_user_id_7ddb80d90a ON public.companies_users USING btree (numeric_company_id, numeric_user_id);
+
+
+--
+-- Name: idx_on_numeric_insightable_id_insightable_type_58195392fb; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX idx_on_numeric_insightable_id_insightable_type_58195392fb ON public.excludes_groups USING btree (numeric_insightable_id, insightable_type);
+
+
+--
+-- Name: idx_on_numeric_insightable_id_insightable_type_enti_b01b1b20a5; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX idx_on_numeric_insightable_id_insightable_type_enti_b01b1b20a5 ON public.ignores USING btree (numeric_insightable_id, insightable_type, entity_value);
+
+
+--
+-- Name: idx_on_numeric_inviteable_id_inviteable_type_numeri_d4079f4003; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX idx_on_numeric_inviteable_id_inviteable_type_numeri_d4079f4003 ON public.invites USING btree (numeric_inviteable_id, inviteable_type, numeric_receiver_id);
+
+
+--
+-- Name: idx_on_numeric_notifyable_id_notifyable_type_3479f2327d; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX idx_on_numeric_notifyable_id_notifyable_type_3479f2327d ON public.notifications USING btree (numeric_notifyable_id, notifyable_type);
+
+
+--
+-- Name: idx_on_numeric_webhook_id_notification_type_3de333d1a8; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX idx_on_numeric_webhook_id_notification_type_3de333d1a8 ON public.notifications USING btree (numeric_webhook_id, notification_type);
+
+
+--
+-- Name: idx_on_numeric_worktimeable_id_worktimeable_type_a086a988c8; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX idx_on_numeric_worktimeable_id_worktimeable_type_a086a988c8 ON public.work_times USING btree (numeric_worktimeable_id, worktimeable_type);
+
+
+--
+-- Name: index_access_tokens_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_access_tokens_on_id ON public.access_tokens USING btree (id);
+
+
+--
+-- Name: index_access_tokens_on_numeric_tokenable_id_and_tokenable_type; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_access_tokens_on_numeric_tokenable_id_and_tokenable_type ON public.access_tokens USING btree (numeric_tokenable_id, tokenable_type);
+
+
--
-- Name: index_access_tokens_on_tokenable_id_and_tokenable_type; Type: INDEX; Schema: public; Owner: -
--
@@ -2190,24 +1586,24 @@ CREATE UNIQUE INDEX index_access_tokens_on_tokenable_id_and_tokenable_type ON pu
--
--- Name: index_access_tokens_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_api_access_tokens_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_access_tokens_on_uuid ON public.access_tokens USING btree (uuid);
+CREATE INDEX index_api_access_tokens_on_id ON public.api_access_tokens USING btree (id);
--
--- Name: index_api_access_tokens_on_user_id; Type: INDEX; Schema: public; Owner: -
+-- Name: index_api_access_tokens_on_numeric_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_api_access_tokens_on_user_id ON public.api_access_tokens USING btree (user_id);
+CREATE INDEX index_api_access_tokens_on_numeric_user_id ON public.api_access_tokens USING btree (numeric_user_id);
--
--- Name: index_api_access_tokens_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_api_access_tokens_on_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_api_access_tokens_on_uuid ON public.api_access_tokens USING btree (uuid);
+CREATE INDEX index_api_access_tokens_on_user_id ON public.api_access_tokens USING btree (user_id);
--
@@ -2218,17 +1614,24 @@ CREATE INDEX index_api_access_tokens_on_value ON public.api_access_tokens USING
--
--- Name: index_companies_on_user_id; Type: INDEX; Schema: public; Owner: -
+-- Name: index_companies_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_companies_on_user_id ON public.companies USING btree (user_id);
+CREATE UNIQUE INDEX index_companies_on_id ON public.companies USING btree (id);
+
+
+--
+-- Name: index_companies_on_numeric_user_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_companies_on_numeric_user_id ON public.companies USING btree (numeric_user_id);
--
--- Name: index_companies_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_companies_on_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_companies_on_uuid ON public.companies USING btree (uuid);
+CREATE INDEX index_companies_on_user_id ON public.companies USING btree (user_id);
--
@@ -2238,6 +1641,13 @@ CREATE UNIQUE INDEX index_companies_on_uuid ON public.companies USING btree (uui
CREATE UNIQUE INDEX index_companies_users_on_company_id_and_user_id ON public.companies_users USING btree (company_id, user_id);
+--
+-- Name: index_companies_users_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_companies_users_on_id ON public.companies_users USING btree (id);
+
+
--
-- Name: index_companies_users_on_invite_id; Type: INDEX; Schema: public; Owner: -
--
@@ -2246,10 +1656,10 @@ CREATE INDEX index_companies_users_on_invite_id ON public.companies_users USING
--
--- Name: index_companies_users_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_companies_users_on_numeric_invite_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_companies_users_on_uuid ON public.companies_users USING btree (uuid);
+CREATE INDEX index_companies_users_on_numeric_invite_id ON public.companies_users USING btree (numeric_invite_id);
--
@@ -2259,6 +1669,13 @@ CREATE UNIQUE INDEX index_companies_users_on_uuid ON public.companies_users USIN
CREATE UNIQUE INDEX index_emailbutler_messages_on_uuid ON public.emailbutler_messages USING btree (uuid);
+--
+-- Name: index_entities_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_entities_on_id ON public.entities USING btree (id);
+
+
--
-- Name: index_entities_on_identity_id; Type: INDEX; Schema: public; Owner: -
--
@@ -2267,17 +1684,17 @@ CREATE INDEX index_entities_on_identity_id ON public.entities USING btree (ident
--
--- Name: index_entities_on_provider_and_external_id; Type: INDEX; Schema: public; Owner: -
+-- Name: index_entities_on_numeric_identity_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_entities_on_provider_and_external_id ON public.entities USING btree (provider, external_id);
+CREATE INDEX index_entities_on_numeric_identity_id ON public.entities USING btree (numeric_identity_id);
--
--- Name: index_entities_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_entities_on_provider_and_external_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_entities_on_uuid ON public.entities USING btree (uuid);
+CREATE UNIQUE INDEX index_entities_on_provider_and_external_id ON public.entities USING btree (provider, external_id);
--
@@ -2330,17 +1747,17 @@ CREATE INDEX index_event_store_events_on_valid_at ON public.event_store_events U
--
--- Name: index_excludes_groups_on_insightable_id_and_insightable_type; Type: INDEX; Schema: public; Owner: -
+-- Name: index_excludes_groups_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_excludes_groups_on_insightable_id_and_insightable_type ON public.excludes_groups USING btree (insightable_id, insightable_type);
+CREATE UNIQUE INDEX index_excludes_groups_on_id ON public.excludes_groups USING btree (id);
--
--- Name: index_excludes_groups_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_excludes_groups_on_insightable_id_and_insightable_type; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_excludes_groups_on_uuid ON public.excludes_groups USING btree (uuid);
+CREATE INDEX index_excludes_groups_on_insightable_id_and_insightable_type ON public.excludes_groups USING btree (insightable_id, insightable_type);
--
@@ -2351,10 +1768,31 @@ CREATE INDEX index_excludes_rules_on_excludes_group_id ON public.excludes_rules
--
--- Name: index_excludes_rules_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_excludes_rules_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_excludes_rules_on_id ON public.excludes_rules USING btree (id);
+
+
+--
+-- Name: index_excludes_rules_on_numeric_excludes_group_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_excludes_rules_on_numeric_excludes_group_id ON public.excludes_rules USING btree (numeric_excludes_group_id);
+
+
+--
+-- Name: index_feedbacks_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_excludes_rules_on_uuid ON public.excludes_rules USING btree (uuid);
+CREATE UNIQUE INDEX index_feedbacks_on_id ON public.feedbacks USING btree (id);
+
+
+--
+-- Name: index_feedbacks_on_numeric_user_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_feedbacks_on_numeric_user_id ON public.feedbacks USING btree (numeric_user_id);
--
@@ -2365,10 +1803,17 @@ CREATE INDEX index_feedbacks_on_user_id ON public.feedbacks USING btree (user_id
--
--- Name: index_feedbacks_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_identities_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_identities_on_id ON public.identities USING btree (id);
+
+
+--
+-- Name: index_identities_on_numeric_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_feedbacks_on_uuid ON public.feedbacks USING btree (uuid);
+CREATE INDEX index_identities_on_numeric_user_id ON public.identities USING btree (numeric_user_id);
--
@@ -2386,24 +1831,24 @@ CREATE INDEX index_identities_on_user_id ON public.identities USING btree (user_
--
--- Name: index_identities_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_ignores_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_identities_on_uuid ON public.identities USING btree (uuid);
+CREATE UNIQUE INDEX index_ignores_on_id ON public.ignores USING btree (id);
--
--- Name: index_ignores_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_insights_on_entity_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_ignores_on_uuid ON public.ignores USING btree (uuid);
+CREATE INDEX index_insights_on_entity_id ON public.insights USING btree (entity_id);
--
--- Name: index_insights_on_entity_id; Type: INDEX; Schema: public; Owner: -
+-- Name: index_insights_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_insights_on_entity_id ON public.insights USING btree (entity_id);
+CREATE UNIQUE INDEX index_insights_on_id ON public.insights USING btree (id);
--
@@ -2414,17 +1859,31 @@ CREATE INDEX index_insights_on_insightable_id_and_insightable_type ON public.ins
--
--- Name: index_insights_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_insights_on_numeric_entity_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_insights_on_numeric_entity_id ON public.insights USING btree (numeric_entity_id);
+
+
+--
+-- Name: index_insights_on_numeric_insightable_id_and_insightable_type; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_insights_on_numeric_insightable_id_and_insightable_type ON public.insights USING btree (numeric_insightable_id, insightable_type);
+
+
+--
+-- Name: index_invites_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_insights_on_uuid ON public.insights USING btree (uuid);
+CREATE UNIQUE INDEX index_invites_on_id ON public.invites USING btree (id);
--
--- Name: index_invites_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_issue_comments_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_invites_on_uuid ON public.invites USING btree (uuid);
+CREATE UNIQUE INDEX index_issue_comments_on_id ON public.issue_comments USING btree (id);
--
@@ -2435,24 +1894,31 @@ CREATE INDEX index_issue_comments_on_issue_id ON public.issue_comments USING btr
--
--- Name: index_issue_comments_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_issue_comments_on_numeric_issue_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_issue_comments_on_uuid ON public.issue_comments USING btree (uuid);
+CREATE INDEX index_issue_comments_on_numeric_issue_id ON public.issue_comments USING btree (numeric_issue_id);
--
--- Name: index_issues_on_repository_id; Type: INDEX; Schema: public; Owner: -
+-- Name: index_issues_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_issues_on_repository_id ON public.issues USING btree (repository_id);
+CREATE UNIQUE INDEX index_issues_on_id ON public.issues USING btree (id);
+
+
+--
+-- Name: index_issues_on_numeric_repository_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_issues_on_numeric_repository_id ON public.issues USING btree (numeric_repository_id);
--
--- Name: index_issues_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_issues_on_repository_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_issues_on_uuid ON public.issues USING btree (uuid);
+CREATE INDEX index_issues_on_repository_id ON public.issues USING btree (repository_id);
--
@@ -2498,17 +1964,24 @@ CREATE INDEX index_kudos_users_achievements_on_kudos_achievement_id ON public.ku
--
--- Name: index_notifications_on_notifyable_id_and_notifyable_type; Type: INDEX; Schema: public; Owner: -
+-- Name: index_kudos_users_achievements_on_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_notifications_on_notifyable_id_and_notifyable_type ON public.notifications USING btree (notifyable_id, notifyable_type);
+CREATE INDEX index_kudos_users_achievements_on_user_id ON public.kudos_users_achievements USING btree (user_id);
+
+
+--
+-- Name: index_notifications_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_notifications_on_id ON public.notifications USING btree (id);
--
--- Name: index_notifications_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_notifications_on_notifyable_id_and_notifyable_type; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_notifications_on_uuid ON public.notifications USING btree (uuid);
+CREATE INDEX index_notifications_on_notifyable_id_and_notifyable_type ON public.notifications USING btree (notifyable_id, notifyable_type);
--
@@ -2518,6 +1991,13 @@ CREATE INDEX index_notifications_on_uuid ON public.notifications USING btree (uu
CREATE UNIQUE INDEX index_notifications_on_webhook_id_and_notification_type ON public.notifications USING btree (webhook_id, notification_type);
+--
+-- Name: index_pull_requests_comments_on_entity_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_pull_requests_comments_on_entity_id ON public.pull_requests_comments USING btree (entity_id);
+
+
--
-- Name: index_pull_requests_comments_on_external_id; Type: INDEX; Schema: public; Owner: -
--
@@ -2526,10 +2006,17 @@ CREATE INDEX index_pull_requests_comments_on_external_id ON public.pull_requests
--
--- Name: index_pull_requests_comments_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_pull_requests_comments_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_pull_requests_comments_on_id ON public.pull_requests_comments USING btree (id);
+
+
+--
+-- Name: index_pull_requests_comments_on_pull_request_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_pull_requests_comments_on_uuid ON public.pull_requests_comments USING btree (uuid);
+CREATE INDEX index_pull_requests_comments_on_pull_request_id ON public.pull_requests_comments USING btree (pull_request_id);
--
@@ -2539,6 +2026,27 @@ CREATE UNIQUE INDEX index_pull_requests_comments_on_uuid ON public.pull_requests
CREATE INDEX index_pull_requests_on_entity_id ON public.pull_requests USING btree (entity_id);
+--
+-- Name: index_pull_requests_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_pull_requests_on_id ON public.pull_requests USING btree (id);
+
+
+--
+-- Name: index_pull_requests_on_numeric_entity_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_pull_requests_on_numeric_entity_id ON public.pull_requests USING btree (numeric_entity_id);
+
+
+--
+-- Name: index_pull_requests_on_numeric_repository_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_pull_requests_on_numeric_repository_id ON public.pull_requests USING btree (numeric_repository_id);
+
+
--
-- Name: index_pull_requests_on_repository_id; Type: INDEX; Schema: public; Owner: -
--
@@ -2547,10 +2055,10 @@ CREATE INDEX index_pull_requests_on_repository_id ON public.pull_requests USING
--
--- Name: index_pull_requests_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_pull_requests_reviews_on_entity_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_pull_requests_on_uuid ON public.pull_requests USING btree (uuid);
+CREATE INDEX index_pull_requests_reviews_on_entity_id ON public.pull_requests_reviews USING btree (entity_id);
--
@@ -2561,24 +2069,38 @@ CREATE INDEX index_pull_requests_reviews_on_external_id ON public.pull_requests_
--
--- Name: index_pull_requests_reviews_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_pull_requests_reviews_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_pull_requests_reviews_on_uuid ON public.pull_requests_reviews USING btree (uuid);
+CREATE UNIQUE INDEX index_pull_requests_reviews_on_id ON public.pull_requests_reviews USING btree (id);
--
--- Name: index_repositories_insights_on_repository_id; Type: INDEX; Schema: public; Owner: -
+-- Name: index_pull_requests_reviews_on_pull_request_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_repositories_insights_on_repository_id ON public.repositories_insights USING btree (repository_id);
+CREATE INDEX index_pull_requests_reviews_on_pull_request_id ON public.pull_requests_reviews USING btree (pull_request_id);
+
+
+--
+-- Name: index_repositories_insights_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_repositories_insights_on_id ON public.repositories_insights USING btree (id);
+
+
+--
+-- Name: index_repositories_insights_on_numeric_repository_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_repositories_insights_on_numeric_repository_id ON public.repositories_insights USING btree (numeric_repository_id);
--
--- Name: index_repositories_insights_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_repositories_insights_on_repository_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_repositories_insights_on_uuid ON public.repositories_insights USING btree (uuid);
+CREATE INDEX index_repositories_insights_on_repository_id ON public.repositories_insights USING btree (repository_id);
--
@@ -2589,10 +2111,17 @@ CREATE INDEX index_repositories_on_company_id ON public.repositories USING btree
--
--- Name: index_repositories_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_repositories_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_repositories_on_id ON public.repositories USING btree (id);
+
+
+--
+-- Name: index_repositories_on_numeric_company_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_repositories_on_uuid ON public.repositories USING btree (uuid);
+CREATE INDEX index_repositories_on_numeric_company_id ON public.repositories USING btree (numeric_company_id);
--
@@ -2603,24 +2132,31 @@ CREATE UNIQUE INDEX index_subscribers_on_email ON public.subscribers USING btree
--
--- Name: index_subscribers_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_subscribers_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_subscribers_on_uuid ON public.subscribers USING btree (uuid);
+CREATE UNIQUE INDEX index_subscribers_on_id ON public.subscribers USING btree (id);
--
--- Name: index_subscriptions_on_user_id; Type: INDEX; Schema: public; Owner: -
+-- Name: index_subscriptions_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_subscriptions_on_user_id ON public.subscriptions USING btree (user_id);
+CREATE UNIQUE INDEX index_subscriptions_on_id ON public.subscriptions USING btree (id);
--
--- Name: index_subscriptions_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_subscriptions_on_numeric_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_subscriptions_on_uuid ON public.subscriptions USING btree (uuid);
+CREATE INDEX index_subscriptions_on_numeric_user_id ON public.subscriptions USING btree (numeric_user_id);
+
+
+--
+-- Name: index_subscriptions_on_user_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_subscriptions_on_user_id ON public.subscriptions USING btree (user_id);
--
@@ -2631,10 +2167,24 @@ CREATE UNIQUE INDEX index_users_on_email ON public.users USING btree (email);
--
--- Name: index_users_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_users_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_users_on_id ON public.users USING btree (id);
+
+
+--
+-- Name: index_users_sessions_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_users_sessions_on_id ON public.users_sessions USING btree (id);
+
+
+--
+-- Name: index_users_sessions_on_numeric_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_users_on_uuid ON public.users USING btree (uuid);
+CREATE INDEX index_users_sessions_on_numeric_user_id ON public.users_sessions USING btree (numeric_user_id);
--
@@ -2645,24 +2195,24 @@ CREATE INDEX index_users_sessions_on_user_id ON public.users_sessions USING btre
--
--- Name: index_users_sessions_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_vacations_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_users_sessions_on_uuid ON public.users_sessions USING btree (uuid);
+CREATE UNIQUE INDEX index_vacations_on_id ON public.vacations USING btree (id);
--
--- Name: index_vacations_on_user_id; Type: INDEX; Schema: public; Owner: -
+-- Name: index_vacations_on_numeric_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE INDEX index_vacations_on_user_id ON public.vacations USING btree (user_id);
+CREATE INDEX index_vacations_on_numeric_user_id ON public.vacations USING btree (numeric_user_id);
--
--- Name: index_vacations_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_vacations_on_user_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_vacations_on_uuid ON public.vacations USING btree (uuid);
+CREATE INDEX index_vacations_on_user_id ON public.vacations USING btree (user_id);
--
@@ -2673,17 +2223,24 @@ CREATE UNIQUE INDEX index_webhooks_on_company_id_and_source_and_url ON public.we
--
--- Name: index_webhooks_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_webhooks_on_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_webhooks_on_id ON public.webhooks USING btree (id);
+
+
+--
+-- Name: index_webhooks_on_numeric_company_id_and_source_and_url; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_webhooks_on_uuid ON public.webhooks USING btree (uuid);
+CREATE UNIQUE INDEX index_webhooks_on_numeric_company_id_and_source_and_url ON public.webhooks USING btree (numeric_company_id, source, url);
--
--- Name: index_work_times_on_uuid; Type: INDEX; Schema: public; Owner: -
+-- Name: index_work_times_on_id; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX index_work_times_on_uuid ON public.work_times USING btree (uuid);
+CREATE UNIQUE INDEX index_work_times_on_id ON public.work_times USING btree (id);
--
@@ -2697,7 +2254,7 @@ CREATE UNIQUE INDEX index_work_times_on_worktimeable_id_and_worktimeable_type ON
-- Name: kudos_users_achievements_unique_index; Type: INDEX; Schema: public; Owner: -
--
-CREATE UNIQUE INDEX kudos_users_achievements_unique_index ON public.kudos_users_achievements USING btree (user_id, kudos_achievement_id);
+CREATE UNIQUE INDEX kudos_users_achievements_unique_index ON public.kudos_users_achievements USING btree (numeric_user_id, kudos_achievement_id);
--
@@ -2742,14 +2299,6 @@ CREATE TRIGGER que_job_notify AFTER INSERT ON public.que_jobs FOR EACH ROW WHEN
CREATE TRIGGER que_state_notify AFTER INSERT OR DELETE OR UPDATE ON public.que_jobs FOR EACH ROW WHEN ((NOT (COALESCE(current_setting('que.skip_notify'::text, true), ''::text) = 'true'::text))) EXECUTE FUNCTION public.que_state_notify();
---
--- Name: kudos_users_achievements fk_rails_4621adbc67; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.kudos_users_achievements
- ADD CONSTRAINT fk_rails_4621adbc67 FOREIGN KEY (user_id) REFERENCES public.users(id);
-
-
--
-- Name: kudos_users_achievements fk_rails_db98df5998; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@@ -2773,6 +2322,8 @@ ALTER TABLE ONLY public.kudos_achievements
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
+('20241207182227'),
+('20241207181125'),
('20241207174751'),
('20241207174615'),
('20241021055406'),
diff --git a/engines/authkeeper/app/services/authkeeper/fetch_session_service.rb b/engines/authkeeper/app/services/authkeeper/fetch_session_service.rb
index f0d5cc1b..c8952151 100644
--- a/engines/authkeeper/app/services/authkeeper/fetch_session_service.rb
+++ b/engines/authkeeper/app/services/authkeeper/fetch_session_service.rb
@@ -23,7 +23,7 @@ def extract_uuid(token)
def find_session(payload)
Authkeeper
.configuration.user_session_model.constantize
- .where(uuid: payload.fetch('uuid', '')).first
+ .where(id: payload.fetch('uuid', '')).first
end
end
end
diff --git a/engines/authkeeper/app/services/authkeeper/generate_token_service.rb b/engines/authkeeper/app/services/authkeeper/generate_token_service.rb
index a4ba3da8..efb81ec6 100644
--- a/engines/authkeeper/app/services/authkeeper/generate_token_service.rb
+++ b/engines/authkeeper/app/services/authkeeper/generate_token_service.rb
@@ -8,7 +8,7 @@ def call(user_session:)
{
result: jwt_encoder.encode(
payload: {
- uuid: user_session.uuid
+ uuid: user_session.id
}
)
}
diff --git a/engines/authkeeper/spec/services/authkeeper/fetch_session_service_spec.rb b/engines/authkeeper/spec/services/authkeeper/fetch_session_service_spec.rb
index fb026ea8..df02fcc7 100644
--- a/engines/authkeeper/spec/services/authkeeper/fetch_session_service_spec.rb
+++ b/engines/authkeeper/spec/services/authkeeper/fetch_session_service_spec.rb
@@ -6,10 +6,10 @@
let!(:instance) { described_class.new }
context 'for valid token' do
- let(:token) { JwtEncoder.new.encode(payload: { uuid: session_uuid }) }
+ let(:token) { JwtEncoder.new.encode(payload: { uuid: session_id }) }
context 'for unexisted session' do
- let(:session_uuid) { 'random uuid' }
+ let(:session_id) { 'random uuid' }
it 'does not assign user and fails', :aggregate_failures do
expect(service_call[:result]).to be_nil
@@ -19,7 +19,7 @@
context 'for existed session' do
let(:user_session) { create :user_session }
- let(:session_uuid) { user_session.uuid }
+ let(:session_id) { user_session.id }
it 'assigns user and succeeds', :aggregate_failures do
expect(service_call[:result]).to eq user_session
diff --git a/spec/controllers/api/v1/companies_controller_spec.rb b/spec/controllers/api/v1/companies_controller_spec.rb
index 7ec5e782..274c09b7 100644
--- a/spec/controllers/api/v1/companies_controller_spec.rb
+++ b/spec/controllers/api/v1/companies_controller_spec.rb
@@ -16,14 +16,14 @@
it 'returns companies data', :aggregate_failures do
get :index, params: {
- api_access_token: api_access_token.value, only_fields: 'uuid,title'
+ api_access_token: api_access_token.value, only_fields: 'id,title'
}
expect(response).to have_http_status :ok
expect(response.parsed_body['companies'].size).to eq 1
attributes = response.parsed_body.dig('companies', 0)
- expect(attributes['uuid']).not_to be_nil
+ expect(attributes['id']).not_to be_nil
expect(attributes['title']).not_to be_nil
expect(attributes['repositories_count']).to be_nil
end
diff --git a/spec/controllers/api/v1/insights_controller_spec.rb b/spec/controllers/api/v1/insights_controller_spec.rb
index ae98e6ad..c02217ad 100644
--- a/spec/controllers/api/v1/insights_controller_spec.rb
+++ b/spec/controllers/api/v1/insights_controller_spec.rb
@@ -30,7 +30,7 @@
before { company.update!(user: user) }
it 'returns data', :aggregate_failures do
- get :index, params: { company_id: company.uuid, api_access_token: api_access_token.value }
+ get :index, params: { company_id: company.id, api_access_token: api_access_token.value }
response_values = response.parsed_body.dig('insights', 0, 'values')
@@ -55,7 +55,7 @@
end
it 'returns data', :aggregate_failures do
- get :index, params: { company_id: company.uuid, api_access_token: api_access_token.value }
+ get :index, params: { company_id: company.id, api_access_token: api_access_token.value }
response_values = response.parsed_body.dig('insights', 0, 'values')
@@ -72,7 +72,7 @@
end
it 'returns data', :aggregate_failures do
- get :index, params: { company_id: company.uuid, api_access_token: api_access_token.value }
+ get :index, params: { company_id: company.id, api_access_token: api_access_token.value }
response_values = response.parsed_body.dig('insights', 0, 'values')
@@ -93,7 +93,7 @@
before { company.update!(user: user) }
it 'returns data', :aggregate_failures do
- get :index, params: { repository_id: repository.uuid, api_access_token: api_access_token.value }
+ get :index, params: { repository_id: repository.id, api_access_token: api_access_token.value }
response_values = response.parsed_body.dig('insights', 0, 'values')
diff --git a/spec/controllers/frontend/access_tokens_controller_spec.rb b/spec/controllers/frontend/access_tokens_controller_spec.rb
index 6a03cd0b..0a61b285 100644
--- a/spec/controllers/frontend/access_tokens_controller_spec.rb
+++ b/spec/controllers/frontend/access_tokens_controller_spec.rb
@@ -26,7 +26,7 @@
context 'for existing company' do
let(:request) do
- post :create, params: { company_id: company.uuid, access_token: { value: '' }, pullmetry_access_token: access_token }
+ post :create, params: { company_id: company.id, access_token: { value: '' }, pullmetry_access_token: access_token }
end
before { company.update!(user: user) }
@@ -42,7 +42,7 @@
context 'for valid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid,
+ company_id: company.id,
access_token: {
value: 'github_pat_*****_******',
expired_at: '2024-01-31 13:45'
@@ -80,7 +80,7 @@
context 'for existing repository' do
let(:request) do
post :create, params: {
- repository_id: repository.uuid, access_token: { value: '' }, pullmetry_access_token: access_token
+ repository_id: repository.id, access_token: { value: '' }, pullmetry_access_token: access_token
}
end
@@ -97,7 +97,7 @@
context 'for valid params' do
let(:request) {
post :create, params: {
- repository_id: repository.uuid,
+ repository_id: repository.id,
access_token: {
value: 'github_pat_*****_******',
expired_at: '2024-01-31 13:45'
diff --git a/spec/controllers/frontend/api_access_tokens_controller_spec.rb b/spec/controllers/frontend/api_access_tokens_controller_spec.rb
index 67f6c49d..2f1e1ba4 100644
--- a/spec/controllers/frontend/api_access_tokens_controller_spec.rb
+++ b/spec/controllers/frontend/api_access_tokens_controller_spec.rb
@@ -39,7 +39,7 @@ def do_request
end
context 'for not own api access token' do
- let(:request) { delete :destroy, params: { id: api_access_token.uuid, pullmetry_access_token: access_token } }
+ let(:request) { delete :destroy, params: { id: api_access_token.id, pullmetry_access_token: access_token } }
it 'does not destroy api access token', :aggregate_failures do
expect { request }.not_to change(ApiAccessToken, :count)
@@ -48,7 +48,7 @@ def do_request
end
context 'for own api access token' do
- let(:request) { delete :destroy, params: { id: api_access_token.uuid, pullmetry_access_token: access_token } }
+ let(:request) { delete :destroy, params: { id: api_access_token.id, pullmetry_access_token: access_token } }
before { api_access_token.update!(user: user) }
diff --git a/spec/controllers/frontend/companies/configurations_controller_spec.rb b/spec/controllers/frontend/companies/configurations_controller_spec.rb
index 6b5986d8..26438d1d 100644
--- a/spec/controllers/frontend/companies/configurations_controller_spec.rb
+++ b/spec/controllers/frontend/companies/configurations_controller_spec.rb
@@ -21,7 +21,7 @@
context 'for not existing user company' do
it 'returns forbidden error' do
patch :update, params: {
- company_id: company.uuid, configuration: { average_type: 'median' }, pullmetry_access_token: access_token
+ company_id: company.id, configuration: { average_type: 'median' }, pullmetry_access_token: access_token
}
expect(response).to have_http_status :forbidden
@@ -34,7 +34,7 @@
context 'for invalid params' do
it 'does not update configuration and redirects', :aggregate_failures do
patch :update, params: {
- company_id: company.uuid, configuration: { average_type: '123' }, pullmetry_access_token: access_token
+ company_id: company.id, configuration: { average_type: '123' }, pullmetry_access_token: access_token
}
config = company.reload.config
@@ -47,7 +47,7 @@
context 'for valid params' do
it 'updates regular configuration and redirects', :aggregate_failures do
patch :update, params: {
- company_id: company.uuid, configuration: { average_type: 'median' }, pullmetry_access_token: access_token
+ company_id: company.id, configuration: { average_type: 'median' }, pullmetry_access_token: access_token
}
config = company.reload.config
diff --git a/spec/controllers/frontend/companies/transfers_controller_spec.rb b/spec/controllers/frontend/companies/transfers_controller_spec.rb
index 88075f2f..d0265758 100644
--- a/spec/controllers/frontend/companies/transfers_controller_spec.rb
+++ b/spec/controllers/frontend/companies/transfers_controller_spec.rb
@@ -20,7 +20,7 @@
context 'for not existing user company' do
it 'returns not found response' do
- post :create, params: { company_id: company.uuid, user_uuid: 'unexisting', pullmetry_access_token: access_token }
+ post :create, params: { company_id: company.id, user_id: 'unexisting', pullmetry_access_token: access_token }
expect(response).to have_http_status :not_found
end
@@ -33,7 +33,7 @@
context 'for user by self' do
it 'returns not found response', :aggregate_failures do
- post :create, params: { company_id: company.uuid, user_uuid: user.uuid, pullmetry_access_token: access_token }
+ post :create, params: { company_id: company.id, user_id: user.id, pullmetry_access_token: access_token }
expect(response).to have_http_status :not_found
expect(company.reload.user_id).to eq user.id
@@ -42,7 +42,7 @@
context 'for another target user' do
it 'updates company', :aggregate_failures do
- post :create, params: { company_id: company.uuid, user_uuid: another_user.uuid, pullmetry_access_token: access_token }
+ post :create, params: { company_id: company.id, user_id: another_user.id, pullmetry_access_token: access_token }
expect(response).to have_http_status :ok
expect(company.reload.user_id).to eq another_user.id
@@ -53,7 +53,7 @@
it 'does not update company', :aggregate_failures do
post :create, params: {
- company_id: company.uuid, user_uuid: another_user.uuid, pullmetry_access_token: access_token
+ company_id: company.id, user_id: another_user.id, pullmetry_access_token: access_token
}
expect(response).to have_http_status :ok
@@ -65,7 +65,7 @@
end
def do_request(access_token=nil)
- post :create, params: { company_id: 'unexisting', user_uuid: 'unexisting', pullmetry_access_token: access_token }
+ post :create, params: { company_id: 'unexisting', user_id: 'unexisting', pullmetry_access_token: access_token }
end
end
end
diff --git a/spec/controllers/frontend/companies/users_controller_spec.rb b/spec/controllers/frontend/companies/users_controller_spec.rb
index 69a72a86..b4e8501b 100644
--- a/spec/controllers/frontend/companies/users_controller_spec.rb
+++ b/spec/controllers/frontend/companies/users_controller_spec.rb
@@ -11,7 +11,7 @@
context 'for logged users' do
let!(:company) { create :company }
let!(:companies_user) { create :companies_user }
- let(:request) { delete :destroy, params: { id: companies_user.uuid, pullmetry_access_token: access_token } }
+ let(:request) { delete :destroy, params: { id: companies_user.id, pullmetry_access_token: access_token } }
context 'for company invite' do
before { companies_user.invite.update!(inviteable: company) }
diff --git a/spec/controllers/frontend/companies_controller_spec.rb b/spec/controllers/frontend/companies_controller_spec.rb
index 0e6ee47d..73ac9d9d 100644
--- a/spec/controllers/frontend/companies_controller_spec.rb
+++ b/spec/controllers/frontend/companies_controller_spec.rb
@@ -30,7 +30,7 @@
context 'for external account' do
let(:request) {
post :create, params: {
- company: { title: 'Title', user_uuid: another_user.uuid }, pullmetry_access_token: access_token
+ company: { title: 'Title', user_id: another_user.id }, pullmetry_access_token: access_token
}
}
diff --git a/spec/controllers/frontend/entities/ignores_controller_spec.rb b/spec/controllers/frontend/entities/ignores_controller_spec.rb
index 552a6a3c..cd6e4734 100644
--- a/spec/controllers/frontend/entities/ignores_controller_spec.rb
+++ b/spec/controllers/frontend/entities/ignores_controller_spec.rb
@@ -13,7 +13,7 @@
context 'for invalid company' do
let(:request) {
post :create, params: {
- company_id: company.uuid, entity_ignore: { entity_value: '' }, pullmetry_access_token: access_token
+ company_id: company.id, entity_ignore: { entity_value: '' }, pullmetry_access_token: access_token
}
}
@@ -30,7 +30,7 @@
context 'for invalid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid, entity_ignore: { entity_value: '' }, pullmetry_access_token: access_token
+ company_id: company.id, entity_ignore: { entity_value: '' }, pullmetry_access_token: access_token
}
}
@@ -44,7 +44,7 @@
context 'for valid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid, entity_ignore: { entity_value: 'value' }, pullmetry_access_token: access_token
+ company_id: company.id, entity_ignore: { entity_value: 'value' }, pullmetry_access_token: access_token
}
}
@@ -63,7 +63,7 @@
context 'for logged users' do
let!(:ignore) { create :ignore }
- let(:request) { delete :destroy, params: { id: ignore.uuid, pullmetry_access_token: access_token } }
+ let(:request) { delete :destroy, params: { id: ignore.id, pullmetry_access_token: access_token } }
context 'for not user ignore' do
it 'does not destroy ignore', :aggregate_failures do
diff --git a/spec/controllers/frontend/excludes/groups_controller_spec.rb b/spec/controllers/frontend/excludes/groups_controller_spec.rb
index 9012c206..e227503d 100644
--- a/spec/controllers/frontend/excludes/groups_controller_spec.rb
+++ b/spec/controllers/frontend/excludes/groups_controller_spec.rb
@@ -13,7 +13,7 @@
context 'for invalid company' do
let(:request) {
post :create, params: {
- company_id: company.uuid, pullmetry_access_token: access_token
+ company_id: company.id, pullmetry_access_token: access_token
}
}
@@ -30,7 +30,7 @@
context 'for valid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid,
+ company_id: company.id,
excludes_rules: [{ target: 'title', condition: 'equal', value: 'value' }],
pullmetry_access_token: access_token
}
@@ -51,7 +51,7 @@
context 'for logged users' do
let!(:excludes_group) { create :excludes_group }
- let(:request) { delete :destroy, params: { id: excludes_group.uuid, pullmetry_access_token: access_token } }
+ let(:request) { delete :destroy, params: { id: excludes_group.id, pullmetry_access_token: access_token } }
context 'for not user excludes_group' do
it 'does not destroy excludes_group', :aggregate_failures do
diff --git a/spec/controllers/frontend/insights_controller_spec.rb b/spec/controllers/frontend/insights_controller_spec.rb
index 1167dd6b..f220e04e 100644
--- a/spec/controllers/frontend/insights_controller_spec.rb
+++ b/spec/controllers/frontend/insights_controller_spec.rb
@@ -20,7 +20,7 @@
before { company.update!(user: user) }
it 'returns data', :aggregate_failures do
- get :index, params: { company_id: company.uuid, pullmetry_access_token: access_token, format: :json }
+ get :index, params: { company_id: company.id, pullmetry_access_token: access_token, format: :json }
response_values = response.parsed_body.dig('insights', 0, 'values')
@@ -45,7 +45,7 @@
end
it 'returns data', :aggregate_failures do
- get :index, params: { company_id: company.uuid, pullmetry_access_token: access_token, format: :json }
+ get :index, params: { company_id: company.id, pullmetry_access_token: access_token, format: :json }
response_values = response.parsed_body.dig('insights', 0, 'values')
@@ -62,7 +62,7 @@
end
it 'returns data', :aggregate_failures do
- get :index, params: { company_id: company.uuid, pullmetry_access_token: access_token, format: :json }
+ get :index, params: { company_id: company.id, pullmetry_access_token: access_token, format: :json }
response_values = response.parsed_body.dig('insights', 0, 'values')
@@ -74,7 +74,7 @@
context 'for pdf request' do
it 'returns data' do
- get :index, params: { company_id: company.uuid, pullmetry_access_token: access_token, format: :pdf }
+ get :index, params: { company_id: company.id, pullmetry_access_token: access_token, format: :pdf }
expect(response).to have_http_status :ok
end
@@ -91,7 +91,7 @@
before { company.update!(user: user) }
it 'returns data', :aggregate_failures do
- get :index, params: { repository_id: repository.uuid, pullmetry_access_token: access_token, format: :json }
+ get :index, params: { repository_id: repository.id, pullmetry_access_token: access_token, format: :json }
response_values = response.parsed_body.dig('insights', 0, 'values')
diff --git a/spec/controllers/frontend/invites_controller_spec.rb b/spec/controllers/frontend/invites_controller_spec.rb
index 6767d37c..9c188b17 100644
--- a/spec/controllers/frontend/invites_controller_spec.rb
+++ b/spec/controllers/frontend/invites_controller_spec.rb
@@ -40,7 +40,7 @@
context 'for invalid company' do
let(:request) {
- post :create, params: { company_id: company.uuid, invite: { email: '' }, pullmetry_access_token: access_token }
+ post :create, params: { company_id: company.id, invite: { email: '' }, pullmetry_access_token: access_token }
}
before { company.update!(user: another_user) }
@@ -55,7 +55,7 @@
context 'for read access in company' do
let(:request) {
post :create, params: {
- company_id: company.uuid, invite: { email: 'email@gmail.com' }, pullmetry_access_token: access_token
+ company_id: company.id, invite: { email: 'email@gmail.com' }, pullmetry_access_token: access_token
}
}
@@ -74,7 +74,7 @@
context 'for valid company' do
context 'for invalid params' do
let(:request) {
- post :create, params: { company_id: company.uuid, invite: { email: '' }, pullmetry_access_token: access_token }
+ post :create, params: { company_id: company.id, invite: { email: '' }, pullmetry_access_token: access_token }
}
it 'does not create invite', :aggregate_failures do
@@ -87,7 +87,7 @@
context 'for valid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid, invite: { email: 'email@gmail.com' }, pullmetry_access_token: access_token
+ company_id: company.id, invite: { email: 'email@gmail.com' }, pullmetry_access_token: access_token
}
}
@@ -106,7 +106,7 @@
context 'for logged users' do
let!(:invite) { create :invite }
- let(:request) { delete :destroy, params: { id: invite.uuid, pullmetry_access_token: access_token } }
+ let(:request) { delete :destroy, params: { id: invite.id, pullmetry_access_token: access_token } }
context 'for user invite' do
context 'for not own invite' do
diff --git a/spec/controllers/frontend/notifications_controller_spec.rb b/spec/controllers/frontend/notifications_controller_spec.rb
index 39789ede..d795e8b0 100644
--- a/spec/controllers/frontend/notifications_controller_spec.rb
+++ b/spec/controllers/frontend/notifications_controller_spec.rb
@@ -13,7 +13,7 @@
context 'for invalid company' do
let(:request) {
post :create, params: {
- company_id: company.uuid,
+ company_id: company.id,
webhook_id: 'unexisting',
notification: { notification_type: '' },
pullmetry_access_token: access_token
@@ -33,7 +33,7 @@
context 'for unexisting webhook' do
let(:request) {
post :create, params: {
- company_id: company.uuid,
+ company_id: company.id,
webhook_id: 'unexisting',
notification: { notification_type: '' },
pullmetry_access_token: access_token
@@ -50,8 +50,8 @@
context 'for invalid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid,
- webhook_id: webhook.uuid,
+ company_id: company.id,
+ webhook_id: webhook.id,
notification: { notification_type: '' },
pullmetry_access_token: access_token
}
@@ -67,8 +67,8 @@
context 'for valid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid,
- webhook_id: webhook.uuid,
+ company_id: company.id,
+ webhook_id: webhook.id,
notification: { notification_type: 'insights_data' },
pullmetry_access_token: access_token
}
@@ -101,7 +101,7 @@
context 'for logged users' do
let!(:notification) { create :notification, notifyable: company }
- let(:request) { delete :destroy, params: { id: notification.uuid, pullmetry_access_token: access_token } }
+ let(:request) { delete :destroy, params: { id: notification.id, pullmetry_access_token: access_token } }
context 'for not existing notification' do
let(:request) { delete :destroy, params: { id: 'unexisting', pullmetry_access_token: access_token } }
diff --git a/spec/controllers/frontend/repositories/repository_insights_controller_spec.rb b/spec/controllers/frontend/repositories/repository_insights_controller_spec.rb
index b0c8dafc..a691aa7f 100644
--- a/spec/controllers/frontend/repositories/repository_insights_controller_spec.rb
+++ b/spec/controllers/frontend/repositories/repository_insights_controller_spec.rb
@@ -19,7 +19,7 @@
before { company.update!(user: user) }
it 'returns data', :aggregate_failures do
- get :index, params: { repository_id: repository.uuid, pullmetry_access_token: access_token }
+ get :index, params: { repository_id: repository.id, pullmetry_access_token: access_token }
response_values = response.parsed_body.dig('insight', 'values')
diff --git a/spec/controllers/frontend/repositories_controller_spec.rb b/spec/controllers/frontend/repositories_controller_spec.rb
index ff5d7364..0b88fe76 100644
--- a/spec/controllers/frontend/repositories_controller_spec.rb
+++ b/spec/controllers/frontend/repositories_controller_spec.rb
@@ -10,7 +10,7 @@
context 'for invalid params' do
let(:request) {
post :create, params: {
- repository: { company_uuid: 'unexisting', title: '', link: '' },
+ repository: { company_id: 'unexisting', title: '', link: '' },
pullmetry_access_token: access_token
}
}
@@ -28,7 +28,7 @@
context 'for not existing company' do
let(:request) {
post :create, params: {
- repository: { company_uuid: 'unexisting', title: '', link: '' }, pullmetry_access_token: access_token
+ repository: { company_id: 'unexisting', title: '', link: '' }, pullmetry_access_token: access_token
}
}
@@ -42,7 +42,7 @@
context 'for existing not user company' do
let(:request) {
post :create, params: {
- repository: { company_uuid: company.uuid, title: 'Title', link: 'nam' }, pullmetry_access_token: access_token
+ repository: { company_id: company.id, title: 'Title', link: 'nam' }, pullmetry_access_token: access_token
}
}
@@ -56,7 +56,7 @@
context 'for invalid params' do
let(:request) {
post :create, params: {
- repository: { company_uuid: company.uuid, title: '', link: '' }, pullmetry_access_token: access_token
+ repository: { company_id: company.id, title: '', link: '' }, pullmetry_access_token: access_token
}
}
@@ -72,7 +72,7 @@
context 'for invalid external_id' do
let(:request) {
post :create, params: {
- repository: { company_uuid: company.uuid, title: 'Title', link: 'link', provider: 'gitlab' },
+ repository: { company_id: company.id, title: 'Title', link: 'link', provider: 'gitlab' },
pullmetry_access_token: access_token
}
}
@@ -90,7 +90,7 @@
let(:request) {
post :create, params: {
repository: {
- company_uuid: company.uuid,
+ company_id: company.id,
title: 'Title',
link: 'https://gitlab.com',
provider: 'gitlab',
@@ -112,7 +112,7 @@
let(:request) {
post :create, params: {
repository: {
- company_uuid: company.uuid, title: 'Title', link: 'https://github.com', provider: 'github'
+ company_id: company.id, title: 'Title', link: 'https://github.com', provider: 'github'
},
pullmetry_access_token: access_token
}
diff --git a/spec/controllers/frontend/webhooks_controller_spec.rb b/spec/controllers/frontend/webhooks_controller_spec.rb
index 447cff62..f12e68ed 100644
--- a/spec/controllers/frontend/webhooks_controller_spec.rb
+++ b/spec/controllers/frontend/webhooks_controller_spec.rb
@@ -13,7 +13,7 @@
context 'for invalid company' do
let(:request) {
post :create, params: {
- company_id: company.uuid, webhook: { source: 'custom', url: '' }, pullmetry_access_token: access_token
+ company_id: company.id, webhook: { source: 'custom', url: '' }, pullmetry_access_token: access_token
}
}
@@ -30,7 +30,7 @@
context 'for invalid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid, webhook: { source: 'custom', url: '' }, pullmetry_access_token: access_token
+ company_id: company.id, webhook: { source: 'custom', url: '' }, pullmetry_access_token: access_token
}
}
@@ -44,7 +44,7 @@
context 'for unexisting source' do
let(:request) {
post :create, params: {
- company_id: company.uuid, webhook: { source: 'unexisting', url: '1123' }, pullmetry_access_token: access_token
+ company_id: company.id, webhook: { source: 'unexisting', url: '1123' }, pullmetry_access_token: access_token
}
}
@@ -60,7 +60,7 @@
context 'for invalid url format' do
let(:request) {
post :create, params: {
- company_id: company.uuid, webhook: { source: 'slack', url: '1123' }, pullmetry_access_token: access_token
+ company_id: company.id, webhook: { source: 'slack', url: '1123' }, pullmetry_access_token: access_token
}
}
@@ -74,7 +74,7 @@
context 'for invalid custom url format' do
let(:request) {
post :create, params: {
- company_id: company.uuid, webhook: { source: 'custom', url: '1123' }, pullmetry_access_token: access_token
+ company_id: company.id, webhook: { source: 'custom', url: '1123' }, pullmetry_access_token: access_token
}
}
@@ -88,7 +88,7 @@
context 'for valid params' do
let(:request) {
post :create, params: {
- company_id: company.uuid,
+ company_id: company.id,
webhook: { source: 'slack', url: 'https://hooks.slack.com/services/url' },
pullmetry_access_token: access_token
}
@@ -126,7 +126,7 @@
context 'for valid custom params' do
let(:request) {
post :create, params: {
- company_id: company.uuid,
+ company_id: company.id,
webhook: { source: 'custom', url: 'https://hooks.slack.com/services/url' },
pullmetry_access_token: access_token
}
@@ -147,7 +147,7 @@
context 'for logged users' do
let!(:webhook) { create :webhook, source: Webhook::SLACK }
- let(:request) { delete :destroy, params: { id: webhook.uuid, pullmetry_access_token: access_token } }
+ let(:request) { delete :destroy, params: { id: webhook.id, pullmetry_access_token: access_token } }
context 'for not user webhook' do
it 'does not destroy webhook', :aggregate_failures do
diff --git a/spec/controllers/frontend/work_times_controller_spec.rb b/spec/controllers/frontend/work_times_controller_spec.rb
index 703fa46f..91926263 100644
--- a/spec/controllers/frontend/work_times_controller_spec.rb
+++ b/spec/controllers/frontend/work_times_controller_spec.rb
@@ -63,7 +63,7 @@
end
context 'for existing company' do
- let(:company_id) { company.uuid }
+ let(:company_id) { company.id }
it 'does not create work time', :aggregate_failures do
expect { request }.to change(WorkTime, :count).by(1)
diff --git a/spec/controllers/web/companies/configurations_controller_spec.rb b/spec/controllers/web/companies/configurations_controller_spec.rb
index 23b89fad..053f0670 100644
--- a/spec/controllers/web/companies/configurations_controller_spec.rb
+++ b/spec/controllers/web/companies/configurations_controller_spec.rb
@@ -26,7 +26,7 @@
context 'for not existing user company' do
it 'renders access page' do
- get :edit, params: { company_id: company.uuid, locale: 'en' }
+ get :edit, params: { company_id: company.id, locale: 'en' }
expect(response).to render_template 'shared/access'
end
@@ -40,7 +40,7 @@
end
it 'renders access page' do
- get :edit, params: { company_id: company.uuid, locale: 'en' }
+ get :edit, params: { company_id: company.id, locale: 'en' }
expect(response).to render_template 'shared/access'
end
@@ -50,7 +50,7 @@
before { company.update!(user: @current_user) }
it 'renders new template' do
- get :edit, params: { company_id: company.uuid, locale: 'en' }
+ get :edit, params: { company_id: company.id, locale: 'en' }
expect(response).to render_template :edit
end
diff --git a/spec/controllers/web/companies/repositories_controller_spec.rb b/spec/controllers/web/companies/repositories_controller_spec.rb
index 8a6f1165..5177fd40 100644
--- a/spec/controllers/web/companies/repositories_controller_spec.rb
+++ b/spec/controllers/web/companies/repositories_controller_spec.rb
@@ -25,7 +25,7 @@
end
it 'renders index page' do
- get :index, params: { company_id: company.uuid, locale: 'en' }
+ get :index, params: { company_id: company.id, locale: 'en' }
expect(response).to render_template 'repositories/index'
end
@@ -36,7 +36,7 @@
context 'without repositories' do
it 'renders index page' do
- get :index, params: { company_id: company.uuid, locale: 'en' }
+ get :index, params: { company_id: company.id, locale: 'en' }
expect(response).to render_template 'repositories/index'
end
@@ -49,7 +49,7 @@
end
it 'renders index page' do
- get :index, params: { company_id: company.uuid, locale: 'en' }
+ get :index, params: { company_id: company.id, locale: 'en' }
expect(response).to render_template 'repositories/index'
end
diff --git a/spec/controllers/web/companies_controller_spec.rb b/spec/controllers/web/companies_controller_spec.rb
index da94ba3b..6d858eca 100644
--- a/spec/controllers/web/companies_controller_spec.rb
+++ b/spec/controllers/web/companies_controller_spec.rb
@@ -52,14 +52,14 @@ def do_request
context 'for not existing user company' do
it 'renders 404 page' do
- delete :destroy, params: { id: company.uuid, locale: 'en' }
+ delete :destroy, params: { id: company.id, locale: 'en' }
expect(response).to render_template 'shared/404'
end
end
context 'for existing user company' do
- let(:request) { delete :destroy, params: { id: company.uuid, locale: 'en' } }
+ let(:request) { delete :destroy, params: { id: company.id, locale: 'en' } }
before { company.update!(user: @current_user) }
diff --git a/spec/controllers/web/repositories_controller_spec.rb b/spec/controllers/web/repositories_controller_spec.rb
index c47a45ad..62bb73ab 100644
--- a/spec/controllers/web/repositories_controller_spec.rb
+++ b/spec/controllers/web/repositories_controller_spec.rb
@@ -54,14 +54,14 @@ def do_request
context 'for not existing user company' do
it 'renders 404 page' do
- delete :destroy, params: { id: repository.uuid, locale: 'en' }
+ delete :destroy, params: { id: repository.id, locale: 'en' }
expect(response).to render_template 'shared/404'
end
end
context 'for existing user company' do
- let(:request) { delete :destroy, params: { id: repository.uuid, locale: 'en' } }
+ let(:request) { delete :destroy, params: { id: repository.id, locale: 'en' } }
before { repository.company.update!(user: @current_user) }
diff --git a/spec/controllers/web/users/omniauth_callbacks_controller_spec.rb b/spec/controllers/web/users/omniauth_callbacks_controller_spec.rb
index c614d7a5..6de1d1b3 100644
--- a/spec/controllers/web/users/omniauth_callbacks_controller_spec.rb
+++ b/spec/controllers/web/users/omniauth_callbacks_controller_spec.rb
@@ -121,12 +121,12 @@
end
end
- context 'with invite uuid in session' do
+ context 'with invite id in session' do
let!(:invite) { create :invite }
before do
cookies[:pullmetry_invite_uuid] = {
- value: invite.uuid,
+ value: invite.id,
expires: 1.week.from_now
}
end
diff --git a/spec/controllers/web/welcome_controller_spec.rb b/spec/controllers/web/welcome_controller_spec.rb
index 096c2504..8168744c 100644
--- a/spec/controllers/web/welcome_controller_spec.rb
+++ b/spec/controllers/web/welcome_controller_spec.rb
@@ -26,7 +26,7 @@
get :index, params: { invite_code: invite.code, invite_email: invite.email }
expect(response).to render_template :index
- expect(cookies[:pullmetry_invite_uuid]).to eq invite.uuid
+ expect(cookies[:pullmetry_invite_uuid]).to eq invite.id
end
end
end
diff --git a/spec/controllers/webhooks/cryptoclouds_controller_spec.rb b/spec/controllers/webhooks/cryptoclouds_controller_spec.rb
index 44607f1c..5b152bfe 100644
--- a/spec/controllers/webhooks/cryptoclouds_controller_spec.rb
+++ b/spec/controllers/webhooks/cryptoclouds_controller_spec.rb
@@ -29,7 +29,7 @@
context 'when user is found' do
let!(:user) { create :user }
- let(:order_id) { JwtEncoder.new.encode(payload: { uuid: user.uuid, days_period: 30 }) }
+ let(:order_id) { JwtEncoder.new.encode(payload: { uuid: user.id, days_period: 30 }) }
context 'when order id is invalid' do
let(:request) { post :create, params: { status: 'success', order_id: '123' } }
@@ -75,7 +75,7 @@
before do
allow(Pullmetry::Container.resolve('jwt_encoder')).to(
- receive(:decode).with(token: order_id).and_return({ 'uuid' => user.uuid, 'days_period' => 30 })
+ receive(:decode).with(token: order_id).and_return({ 'uuid' => user.id, 'days_period' => 30 })
)
allow(Pullmetry::Container.resolve('jwt_encoder')).to(
diff --git a/spec/requests/api/v1/companies_spec.rb b/spec/requests/api/v1/companies_spec.rb
index 645b19aa..9139db13 100644
--- a/spec/requests/api/v1/companies_spec.rb
+++ b/spec/requests/api/v1/companies_spec.rb
@@ -42,7 +42,7 @@
items: {
type: :object,
properties: {
- uuid: { type: :string },
+ id: { type: :string, format: :uuid },
title: { type: :string },
repositories_count: { type: :integer, nullable: true },
accessable: { type: :boolean }
@@ -86,14 +86,14 @@
produces 'application/json'
consumes 'application/json'
- parameter name: :id, in: :path, type: :string, description: 'Company UUID', required: true
+ parameter name: :id, in: :path, type: :string, format: :uuid, description: 'Company ID', required: true
parameter name: :api_access_token, in: :query, type: :string, description: 'API access token', required: true
response(200, 'successful') do
let(:user) { create :user }
let(:api_access_token) { create(:api_access_token, user: user).value }
let(:company) { create(:company, user: user) }
- let(:id) { company.uuid }
+ let(:id) { company.id }
let(:insight) { create :insight, insightable: company }
after do |example|
diff --git a/spec/requests/api/v1/repositories_spec.rb b/spec/requests/api/v1/repositories_spec.rb
index 41da62fe..02339820 100644
--- a/spec/requests/api/v1/repositories_spec.rb
+++ b/spec/requests/api/v1/repositories_spec.rb
@@ -13,7 +13,7 @@
produces 'application/json'
consumes 'application/json'
- parameter name: :id, in: :path, type: :string, description: 'Repository UUID', required: true
+ parameter name: :id, in: :path, type: :string, format: :uuid, description: 'Repository ID', required: true
parameter name: :api_access_token, in: :query, type: :string, description: 'API access token', required: true
response(200, 'successful') do
@@ -21,7 +21,7 @@
let(:api_access_token) { create(:api_access_token, user: user).value }
let(:company) { create :company, user: user }
let(:repository) { create :repository, company: company }
- let(:id) { repository.uuid }
+ let(:id) { repository.id }
let(:insight) { create :insight, insightable: repository }
after do |example|
diff --git a/spec/services/insights/time/for_review_spec.rb b/spec/services/insights/time/for_review_spec.rb
index 6423b497..fed6d1b3 100644
--- a/spec/services/insights/time/for_review_spec.rb
+++ b/spec/services/insights/time/for_review_spec.rb
@@ -29,7 +29,8 @@
let(:insightable) { repository }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [43_200, 7_200], entity2.id => [3_600] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 43_200)
+ expect(service_call[:result][entity2.id]).to contain_exactly(3_600)
expect(service_call[:errors]).to be_blank
end
@@ -56,7 +57,8 @@
let(:insightable) { repository.company }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [43_200, 7_200], entity2.id => [3_600] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 43_200)
+ expect(service_call[:result][entity2.id]).to contain_exactly(3_600)
expect(service_call[:errors]).to be_blank
end
end
@@ -68,7 +70,8 @@
let(:insightable) { repository }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [18_000, 7_200], entity2.id => [3_600] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 18_000)
+ expect(service_call[:result][entity2.id]).to contain_exactly(3_600)
expect(service_call[:errors]).to be_blank
end
end
@@ -77,7 +80,8 @@
let(:insightable) { repository.company }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [18_000, 7_200], entity2.id => [3_600] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 18_000)
+ expect(service_call[:result][entity2.id]).to contain_exactly(3_600)
expect(service_call[:errors]).to be_blank
end
end
@@ -89,7 +93,8 @@
let(:insightable) { repository }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [50_400, 7_200], entity2.id => [3_600] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 50_400)
+ expect(service_call[:result][entity2.id]).to contain_exactly(3_600)
expect(service_call[:errors]).to be_blank
end
end
@@ -98,7 +103,8 @@
let(:insightable) { repository.company }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [50_400, 7_200], entity2.id => [3_600] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 50_400)
+ expect(service_call[:result][entity2.id]).to contain_exactly(3_600)
expect(service_call[:errors]).to be_blank
end
end
@@ -110,7 +116,8 @@
let(:insightable) { repository }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [50_400, 7_200], entity2.id => [14_400] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 50_400)
+ expect(service_call[:result][entity2.id]).to contain_exactly(14_400)
expect(service_call[:errors]).to be_blank
end
end
@@ -119,7 +126,8 @@
let(:insightable) { repository.company }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [50_400, 7_200], entity2.id => [14_400] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 50_400)
+ expect(service_call[:result][entity2.id]).to contain_exactly(14_400)
expect(service_call[:errors]).to be_blank
end
end
@@ -132,7 +140,8 @@
let(:insightable) { repository }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [50_400, 7_200], entity2.id => [32_400] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 50_400)
+ expect(service_call[:result][entity2.id]).to contain_exactly(32_400)
expect(service_call[:errors]).to be_blank
end
end
@@ -141,7 +150,8 @@
let(:insightable) { repository.company }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [50_400, 7_200], entity2.id => [32_400] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 50_400)
+ expect(service_call[:result][entity2.id]).to contain_exactly(32_400)
expect(service_call[:errors]).to be_blank
end
end
@@ -157,7 +167,8 @@
let(:insightable) { repository }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [50_400, 7_200], entity2.id => [0] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 50_400)
+ expect(service_call[:result][entity2.id]).to contain_exactly(0)
expect(service_call[:errors]).to be_blank
end
end
@@ -166,7 +177,8 @@
let(:insightable) { repository.company }
it 'generates average time and succeeds', :aggregate_failures do
- expect(service_call[:result]).to eq({ entity1.id => [50_400, 7_200], entity2.id => [0] })
+ expect(service_call[:result][entity1.id]).to contain_exactly(7_200, 50_400)
+ expect(service_call[:result][entity2.id]).to contain_exactly(0)
expect(service_call[:errors]).to be_blank
end
end
diff --git a/swagger/v1/swagger.yaml b/swagger/v1/swagger.yaml
index 6dea55a1..9088450e 100644
--- a/swagger/v1/swagger.yaml
+++ b/swagger/v1/swagger.yaml
@@ -44,8 +44,9 @@ paths:
items:
type: object
properties:
- uuid:
+ id:
type: string
+ format: uuid
title:
type: string
repositories_count:
@@ -73,7 +74,8 @@ paths:
parameters:
- name: id
in: path
- description: Company UUID
+ format: uuid
+ description: Company ID
required: true
schema:
type: string
@@ -130,7 +132,8 @@ paths:
parameters:
- name: id
in: path
- description: Repository UUID
+ format: uuid
+ description: Repository ID
required: true
schema:
type: string