Skip to content

Commit

Permalink
Merge pull request #1584 from eikek/more-indexes
Browse files Browse the repository at this point in the history
More indexes
  • Loading branch information
mergify[bot] authored Jun 11, 2022
2 parents 0738bcf + aeeb54f commit fe8d2fc
Show file tree
Hide file tree
Showing 14 changed files with 257 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,17 @@ class AuthTokenTest extends CatsEffectSuite {
!token2.copy(valid = Duration.minutes(10).some).validate(secret, Duration.millis(0))
)
}

test("signature") {
val token1 = AuthToken.user[IO](user, false, secret, None).unsafeRunSync()
val token2 =
AuthToken.user[IO](user, false, secret, Duration.seconds(10).some).unsafeRunSync()

assert(token1.sigValid(secret))
assert(token1.sigInvalid(otherSecret))
assert(token1.copy(valid = Duration.seconds(100).some).sigInvalid(secret))

assert(token2.sigValid(secret))
assert(token2.sigInvalid(otherSecret))
}
}
2 changes: 0 additions & 2 deletions modules/restapi/src/main/resources/docspell-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7841,8 +7841,6 @@ components:
$ref: "#/components/schemas/IdName"
concEquipment:
$ref: "#/components/schemas/IdName"
inReplyTo:
$ref: "#/components/schemas/IdName"
folder:
$ref: "#/components/schemas/IdName"
dueDate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ trait Conversions {
data.corrPerson.map(p => IdName(p.pid, p.name)),
data.concPerson.map(p => IdName(p.pid, p.name)),
data.concEquip.map(e => IdName(e.eid, e.name)),
data.inReplyTo.map(mkIdName),
data.folder.map(mkIdName),
data.item.dueDate,
data.item.notes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ final class ItemSearchPart[F[_]: Async](
identity,
res =>
for {
_ <- logger.warn(s"Searching with query: $res")
_ <- logger.debug(s"Searching with query: $res")
items <- searchOps
.searchSelect(details, cfg.maxNoteLength, today.some, batch)(
res.q,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
create index if not exists addon_archive_cid_idx on addon_archive(cid);
create index if not exists addon_archive_file_id_idx on addon_archive(file_id);
create index if not exists addon_run_config_cid_idx on addon_run_config(cid);
create index if not exists addon_run_config_user_id_idx on addon_run_config(user_id);
create index if not exists addon_run_config_addon_addon_id_idx on addon_run_config_addon(addon_id);
create index if not exists addon_run_config_addon_addon_run_config_id_idx on addon_run_config_addon(addon_run_config_id);
create index if not exists addon_run_config_trigger_addon_run_config_id_idx on addon_run_config_trigger(addon_run_config_id);
create index if not exists attachment_filemetaid_idx on attachment(filemetaid);
create index if not exists attachment_itemid_idx on attachment(itemid);
create index if not exists attachment_archive_id_idx on attachment_archive(id);
create index if not exists attachment_archive_file_id_idx on attachment_archive(file_id);
create index if not exists attachment_preview_id_idx on attachment_preview(id);
create index if not exists attachment_preview_file_id_idx on attachment_preview(file_id);
create index if not exists attachment_source_id_idx on attachment_source(id);
create index if not exists attachment_source_file_id_idx on attachment_source(file_id);
create index if not exists attachmentmeta_attachid_idx on attachmentmeta(attachid);
create index if not exists classifier_model_cid_idx on classifier_model(cid);
create index if not exists classifier_model_file_id_idx on classifier_model(file_id);
create index if not exists classifier_setting_cid_idx on classifier_setting(cid);
create index if not exists client_settings_collective_cid_idx on client_settings_collective(cid);
create index if not exists client_settings_user_id_idx on client_settings_user(user_id);
create index if not exists collective_password_cid_idx on collective_password(cid);
create index if not exists contact_oid_idx on contact(oid);
create index if not exists contact_pid_idx on contact(pid);
create index if not exists custom_field_cid_idx on custom_field(cid);
create index if not exists custom_field_value_field_idx on custom_field_value(field);
create index if not exists custom_field_value_item_id_idx on custom_field_value(item_id);
create index if not exists download_query_cid_idx on download_query(cid);
create index if not exists download_query_file_id_idx on download_query(file_id);
create index if not exists empty_trash_setting_cid_idx on empty_trash_setting(cid);
create index if not exists equipment_cid_idx on equipment(cid);
create index if not exists folder_cid_idx on folder(cid);
create index if not exists folder_owner_idx on folder(owner);
create index if not exists folder_member_folder_id_idx on folder_member(folder_id);
create index if not exists folder_member_user_id_idx on folder_member(user_id);
create index if not exists item_cid_idx on item(cid);
create index if not exists item_concequipment_idx on item(concequipment);
create index if not exists item_folder_id_idx on item(folder_id);
create index if not exists item_corrorg_idx on item(corrorg);
create index if not exists item_concperson_idx on item(concperson);
create index if not exists item_corrperson_idx on item(corrperson);
create index if not exists item_link_cid_idx on item_link(cid);
create index if not exists item_link_item1_idx on item_link(item1);
create index if not exists item_link_item2_idx on item_link(item2);
create index if not exists item_proposal_itemid_idx on item_proposal(itemid);
create index if not exists item_share_user_id_idx on item_share(user_id);
create index if not exists joblog_jid_idx on joblog(jid);
create index if not exists notification_channel_gotify_uid_idx on notification_channel_gotify(uid);
create index if not exists notification_channel_http_uid_idx on notification_channel_http(uid);
create index if not exists notification_channel_mail_uid_idx on notification_channel_mail(uid);
create index if not exists notification_channel_mail_conn_id_idx on notification_channel_mail(conn_id);
create index if not exists notification_channel_matrix_uid_idx on notification_channel_matrix(uid);
create index if not exists notification_hook_uid_idx on notification_hook(uid);
create index if not exists notification_hook_channel_channel_gotify_idx on notification_hook_channel(channel_gotify);
create index if not exists notification_hook_channel_channel_http_idx on notification_hook_channel(channel_http);
create index if not exists notification_hook_channel_channel_mail_idx on notification_hook_channel(channel_mail);
create index if not exists notification_hook_channel_channel_matrix_idx on notification_hook_channel(channel_matrix);
create index if not exists notification_hook_channel_hook_id_idx on notification_hook_channel(hook_id);
create index if not exists notification_hook_event_hook_id_idx on notification_hook_event(hook_id);
create index if not exists organization_cid_idx on organization(cid);
create index if not exists person_cid_idx on person(cid);
create index if not exists fk_person_organization on person(oid);
create index if not exists query_bookmark_cid_idx on query_bookmark(cid);
create index if not exists query_bookmark_user_id_idx on query_bookmark(user_id);
create index if not exists rememberme_cid_login_idx on rememberme(cid, login);
create index if not exists sentmail_uid_idx on sentmail(uid);
create index if not exists sentmailitem_item_id_idx on sentmailitem(item_id);
create index if not exists sentmailitem_sentmail_id_idx on sentmailitem(sentmail_id);
create index if not exists source_cid_idx on source(cid);
create index if not exists source_folder_id_idx on source(folder_id);
create index if not exists tag_cid_idx on tag(cid);
create index if not exists tagitem_itemid_idx on tagitem(itemid);
create index if not exists tagitem_tid_idx on tagitem(tid);
create index if not exists tagsource_source_id_idx on tagsource(source_id);
create index if not exists tagsource_tag_id_idx on tagsource(tag_id);
create index if not exists totp_user_id_idx on totp(user_id);
create index if not exists user__cid_idx on user_(cid);
create index if not exists useremail_uid_idx on useremail(uid);
create index if not exists userimap_uid_idx on userimap(uid);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "item" drop column "inreplyto";
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
create index if not exists addon_archive_cid_idx on addon_archive(cid);
create index if not exists addon_archive_file_id_idx on addon_archive(file_id);
create index if not exists addon_run_config_cid_idx on addon_run_config(cid);
create index if not exists addon_run_config_user_id_idx on addon_run_config(user_id);
create index if not exists addon_run_config_addon_addon_id_idx on addon_run_config_addon(addon_id);
create index if not exists addon_run_config_addon_addon_run_config_id_idx on addon_run_config_addon(addon_run_config_id);
create index if not exists addon_run_config_trigger_addon_run_config_id_idx on addon_run_config_trigger(addon_run_config_id);
create index if not exists attachment_filemetaid_idx on attachment(filemetaid);
create index if not exists attachment_itemid_idx on attachment(itemid);
create index if not exists attachment_archive_id_idx on attachment_archive(id);
create index if not exists attachment_archive_file_id_idx on attachment_archive(file_id);
create index if not exists attachment_preview_id_idx on attachment_preview(id);
create index if not exists attachment_preview_file_id_idx on attachment_preview(file_id);
create index if not exists attachment_source_id_idx on attachment_source(id);
create index if not exists attachment_source_file_id_idx on attachment_source(file_id);
create index if not exists attachmentmeta_attachid_idx on attachmentmeta(attachid);
create index if not exists classifier_model_cid_idx on classifier_model(cid);
create index if not exists classifier_model_file_id_idx on classifier_model(file_id);
create index if not exists classifier_setting_cid_idx on classifier_setting(cid);
create index if not exists client_settings_collective_cid_idx on client_settings_collective(cid);
create index if not exists client_settings_user_id_idx on client_settings_user(user_id);
create index if not exists collective_password_cid_idx on collective_password(cid);
create index if not exists contact_oid_idx on contact(oid);
create index if not exists contact_pid_idx on contact(pid);
create index if not exists custom_field_cid_idx on custom_field(cid);
create index if not exists custom_field_value_field_idx on custom_field_value(field);
create index if not exists custom_field_value_item_id_idx on custom_field_value(item_id);
create index if not exists download_query_cid_idx on download_query(cid);
create index if not exists download_query_file_id_idx on download_query(file_id);
create index if not exists empty_trash_setting_cid_idx on empty_trash_setting(cid);
create index if not exists equipment_cid_idx on equipment(cid);
create index if not exists folder_cid_idx on folder(cid);
create index if not exists folder_owner_idx on folder(owner);
create index if not exists folder_member_folder_id_idx on folder_member(folder_id);
create index if not exists folder_member_user_id_idx on folder_member(user_id);
create index if not exists item_cid_idx on item(cid);
create index if not exists item_concequipment_idx on item(concequipment);
create index if not exists item_folder_id_idx on item(folder_id);
create index if not exists item_corrorg_idx on item(corrorg);
create index if not exists item_concperson_idx on item(concperson);
create index if not exists item_corrperson_idx on item(corrperson);
create index if not exists item_link_cid_idx on item_link(cid);
create index if not exists item_link_item1_idx on item_link(item1);
create index if not exists item_link_item2_idx on item_link(item2);
create index if not exists item_proposal_itemid_idx on item_proposal(itemid);
create index if not exists item_share_user_id_idx on item_share(user_id);
create index if not exists joblog_jid_idx on joblog(jid);
create index if not exists notification_channel_gotify_uid_idx on notification_channel_gotify(uid);
create index if not exists notification_channel_http_uid_idx on notification_channel_http(uid);
create index if not exists notification_channel_mail_uid_idx on notification_channel_mail(uid);
create index if not exists notification_channel_mail_conn_id_idx on notification_channel_mail(conn_id);
create index if not exists notification_channel_matrix_uid_idx on notification_channel_matrix(uid);
create index if not exists notification_hook_uid_idx on notification_hook(uid);
create index if not exists notification_hook_channel_channel_gotify_idx on notification_hook_channel(channel_gotify);
create index if not exists notification_hook_channel_channel_http_idx on notification_hook_channel(channel_http);
create index if not exists notification_hook_channel_channel_mail_idx on notification_hook_channel(channel_mail);
create index if not exists notification_hook_channel_channel_matrix_idx on notification_hook_channel(channel_matrix);
create index if not exists notification_hook_channel_hook_id_idx on notification_hook_channel(hook_id);
create index if not exists notification_hook_event_hook_id_idx on notification_hook_event(hook_id);
create index if not exists organization_cid_idx on organization(cid);
create index if not exists person_cid_idx on person(cid);
create index if not exists fk_person_organization on person(oid);
create index if not exists query_bookmark_cid_idx on query_bookmark(cid);
create index if not exists query_bookmark_user_id_idx on query_bookmark(user_id);
create index if not exists rememberme_cid_login_idx on rememberme(cid, login);
create index if not exists sentmail_uid_idx on sentmail(uid);
create index if not exists sentmailitem_item_id_idx on sentmailitem(item_id);
create index if not exists sentmailitem_sentmail_id_idx on sentmailitem(sentmail_id);
create index if not exists source_cid_idx on source(cid);
create index if not exists source_folder_id_idx on source(folder_id);
create index if not exists tag_cid_idx on tag(cid);
create index if not exists tagitem_itemid_idx on tagitem(itemid);
create index if not exists tagitem_tid_idx on tagitem(tid);
create index if not exists tagsource_source_id_idx on tagsource(source_id);
create index if not exists tagsource_tag_id_idx on tagsource(tag_id);
create index if not exists totp_user_id_idx on totp(user_id);
create index if not exists user__cid_idx on user_(cid);
create index if not exists useremail_uid_idx on useremail(uid);
create index if not exists userimap_uid_idx on userimap(uid);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table `item` drop foreign key item_ibfk_1;
alter table `item` drop column `inreplyto` cascade;
Loading

0 comments on commit fe8d2fc

Please sign in to comment.