You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converting Mashbill to a multi-tenant architecture will allow more than the Civil War Governors of Kentucky to use the tool, so that other documentary editing projects can leverage the technology, but also (to some extent) the research by the Kentucky Historical Society.
Supporting multi-tenant use cases requires separating data for each project. Data is currently stored on Hypothes.is, in the Mashbill database, and in the document repository in Github. We'll need a way to configure a new project, setting the project-specific values of each of these. We'll also need to separate data within Mashbill for users and documents. For entities, projects should be able to see and reuse each other's research, but they should not be required to share the same data for the same person if they appear in more than one collection.
Implementation
Move settings for Github repository information, working document directory on the filesystem, and hypothesis group (and API keys, if needed) into a new Project model, which will also contain a project title and any other project-specific information needed.
Add a new project_id foreign key (or belongs_to AR relation) onto documents, entities, users and possibly annotations (the last might not be needed, since annotations belong to a document which will have a project already).
Add filters to all queries to make sure that retrieval is done against current_user.project
Add before_save filters to all models to make sure that data is persisted with current_user.project as the value for the models' project.
Use a project-specific document directory for updates
Use a project-specific github repository for documents
Use a project-specific Hypothes.is group and credentials when syncing
Special handling for Entities
We would like to surface entities from other Mashbill projects so that data can be shared. To this end, we'll make the following changes
Entity Search Screen
Rather than adding a hard restriction to filter on current_user.project, we will search all entities in the system for potential matches.
We will add a new column for "Project" next to each entity.
We'll use Datatables to support sorting and searching.
Entity Display/Edit Screen
When viewing an entity from another project, a new "copy entity" button will appear
Copying an entity will create a new entity from the original, with the same values.
The user will be able to edit the entity's value, but the initial data values will start with the originating project's.
A new copied_entity_id will allow new copied_from and copied_to relationships in the data model.
When displaying an entity in either view or edit mode, any other project's entry for a copied entity will be displayed as read-only for cross-project reference.
The text was updated successfully, but these errors were encountered:
Converting Mashbill to a multi-tenant architecture will allow more than the Civil War Governors of Kentucky to use the tool, so that other documentary editing projects can leverage the technology, but also (to some extent) the research by the Kentucky Historical Society.
Supporting multi-tenant use cases requires separating data for each project. Data is currently stored on Hypothes.is, in the Mashbill database, and in the document repository in Github. We'll need a way to configure a new project, setting the project-specific values of each of these. We'll also need to separate data within Mashbill for users and documents. For entities, projects should be able to see and reuse each other's research, but they should not be required to share the same data for the same person if they appear in more than one collection.
Implementation
Project
model, which will also contain a project title and any other project-specific information needed.project_id
foreign key (orbelongs_to
AR relation) ontodocuments
,entities
,users
and possiblyannotations
(the last might not be needed, since annotations belong to a document which will have a project already).current_user.project
before_save
filters to all models to make sure that data is persisted withcurrent_user.project
as the value for the models' project.Special handling for Entities
We would like to surface entities from other Mashbill projects so that data can be shared. To this end, we'll make the following changes
Entity Search Screen
Rather than adding a hard restriction to filter on
current_user.project
, we will search all entities in the system for potential matches.We will add a new column for "Project" next to each entity.
We'll use Datatables to support sorting and searching.
Entity Display/Edit Screen
When viewing an entity from another project, a new "copy entity" button will appear
copied_entity_id
will allow newcopied_from
andcopied_to
relationships in the data model.The text was updated successfully, but these errors were encountered: