feat(chalice): changed logs

feat(DB): changed oauth_authentication indexes
feat(DB): changed oauth_authentication keys
This commit is contained in:
Taha Yassine Kraiem 2022-09-20 13:40:01 +01:00
parent eadc5aced8
commit 54e68f5124
7 changed files with 28 additions and 8 deletions

View file

@ -52,7 +52,6 @@ def __get_autocomplete_table(value, project_id):
"c_list": tuple(c_list)
})
try:
print(query)
cur.execute(query)
except Exception as err:
print("--------- AUTOCOMPLETE SEARCH QUERY EXCEPTION -----------")

View file

@ -495,7 +495,7 @@ def get_issues(stages, rows, first_stage=None, last_stage=None, drop_only=False)
all_issues_with_context,
first_stage, last_stage)
print("len(transitions) =", len(transitions))
# print("len(transitions) =", len(transitions))
if any(all_errors):
total_drop_corr, conf, is_sign = pearson_corr(transitions, all_errors)

View file

@ -502,7 +502,7 @@ def get_issues(stages, rows, first_stage=None, last_stage=None, drop_only=False)
all_issues_with_context,
first_stage, last_stage)
print("len(transitions) =", len(transitions))
# print("len(transitions) =", len(transitions))
if any(all_errors):
total_drop_corr, conf, is_sign = pearson_corr(transitions, all_errors)

View file

@ -23,5 +23,16 @@ ON CONFLICT (predefined_key) DO UPDATE
metric_type=excluded.metric_type,
view_type=excluded.view_type;
ALTER TABLE IF EXISTS oauth_authentication
DROP CONSTRAINT IF EXISTS oauth_authentication_user_id_provider_provider_user_id_key;
DROP INDEX IF EXISTS oauth_authentication_user_id_provider_provider_user_id_key;
ALTER TABLE IF EXISTS oauth_authentication
DROP CONSTRAINT IF EXISTS oauth_authentication_user_id_provider_key;
DROP INDEX IF EXISTS oauth_authentication_user_id_provider_key;
CREATE UNIQUE INDEX IF NOT EXISTS oauth_authentication_unique_user_id_provider_idx ON oauth_authentication (user_id, provider);
COMMIT;

View file

@ -221,10 +221,9 @@ $$
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE,
provider oauth_provider NOT NULL,
provider_user_id text NOT NULL,
token text NOT NULL,
UNIQUE (user_id, provider)
token text NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS oauth_authentication_unique_user_id_provider_idx ON oauth_authentication(user_id,provider);
CREATE TABLE IF NOT EXISTS projects
(

View file

@ -23,5 +23,16 @@ ON CONFLICT (predefined_key) DO UPDATE
metric_type=excluded.metric_type,
view_type=excluded.view_type;
ALTER TABLE IF EXISTS oauth_authentication
DROP CONSTRAINT IF EXISTS oauth_authentication_user_id_provider_provider_user_id_key;
DROP INDEX IF EXISTS oauth_authentication_user_id_provider_provider_user_id_key;
ALTER TABLE IF EXISTS oauth_authentication
DROP CONSTRAINT IF EXISTS oauth_authentication_user_id_provider_key;
DROP INDEX IF EXISTS oauth_authentication_user_id_provider_key;
CREATE UNIQUE INDEX IF NOT EXISTS oauth_authentication_unique_user_id_provider_idx ON oauth_authentication (user_id, provider);
COMMIT;

View file

@ -165,9 +165,9 @@ $$
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE,
provider oauth_provider NOT NULL,
provider_user_id text NOT NULL,
token text NOT NULL,
UNIQUE (user_id, provider)
token text NOT NULL
);
CREATE UNIQUE INDEX oauth_authentication_unique_user_id_provider_idx ON oauth_authentication(user_id,provider);
-- --- projects.sql ---