Skip to content

Commit 7e870ad

Browse files
committed
doc something
1 parent 4aedb35 commit 7e870ad

20 files changed

+262
-64
lines changed

packages/postgres-database/src/simcore_postgres_database/models/confirmations.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
""" User's confirmations table
1+
"""User's confirmations table
22
3-
- Keeps a list of tokens to identify an action (registration, invitation, reset, etc) authorized
4-
by link to a a user in the framework
5-
- These tokens have an expiration date defined by configuration
3+
- Keeps a list of tokens to identify an action (registration, invitation, reset, etc) authorized
4+
by link to a a user in the framework
5+
- These tokens have an expiration date defined by configuration
66
7+
Migration strategy:
8+
- The primary key is `code`, which is unique and sufficient for migration.
9+
- Ensure `user_id` foreign key references are valid in the target database.
10+
- No additional changes are required; this table can be migrated as is.
711
"""
12+
813
import enum
914

1015
import sqlalchemy as sa

packages/postgres-database/src/simcore_postgres_database/models/groups.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
""" Groups table
1+
"""Groups table
22
3-
- List of groups in the framework
4-
- Groups have a ID, name and a list of users that belong to the group
5-
"""
3+
- Represents user groups in the system.
64
5+
Migration strategy:
6+
- The primary key is `id`, which is unique and sufficient for migration.
7+
- Ensure foreign key references (if any) are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
710

811
import sqlalchemy as sa
912
from common_library.groups_enums import GroupType

packages/postgres-database/src/simcore_postgres_database/models/jinja2_templates.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
""" Collection of jinja2 templates for customizable docs (e.g. emails, sites)
1+
"""Jinja2 templates table
22
3+
- Collection of jinja2 templates for customizable docs (e.g. emails, sites)
4+
5+
Migration strategy:
6+
- The primary key is `id`, which is unique and sufficient for migration.
7+
- No foreign key dependencies exist.
8+
- No additional changes are required; this table can be migrated as is.
39
"""
410

511
import sqlalchemy as sa

packages/postgres-database/src/simcore_postgres_database/models/products.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
"""Products table
22
3+
- Represents products in the system.
34
- List of products served by the simcore platform
45
- Products have a name and an associated host (defined by a regex)
56
- Every product has a front-end with exactly the same name
7+
8+
Migration strategy:
9+
- The primary key is `id`, which is unique and sufficient for migration.
10+
- Ensure foreign key references (if any) are valid in the target database.
611
"""
712

813
import json
@@ -122,6 +127,7 @@ class ProductLoginSettingsDict(TypedDict, total=False):
122127
# NOTE: a default entry is created in the table Product
123128
# see packages/postgres-database/src/simcore_postgres_database/migration/versions/350103a7efbd_modified_products_table.py
124129

130+
125131
products = sa.Table(
126132
"products",
127133
metadata,

packages/postgres-database/src/simcore_postgres_database/models/products_to_templates.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Products to templates table
2+
3+
- Links products to Jinja2 templates.
4+
5+
Migration strategy:
6+
- Composite primary key (`product_id`, `template_id`) is unique and sufficient for migration.
7+
- Ensure foreign key references to `products` and `jinja2_templates` are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212

313
from ._common import (

packages/postgres-database/src/simcore_postgres_database/models/projects.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
""" Projects table
1+
"""Projects table
22
3+
- Represents user projects in the system.
4+
5+
Migration strategy:
6+
- The primary key is `id`, which is unique and sufficient for migration.
7+
- Ensure foreign key references (if any) are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
39
"""
10+
411
import enum
512

613
import sqlalchemy as sa

packages/postgres-database/src/simcore_postgres_database/models/projects_comments.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Projects comments table
2+
3+
- Stores comments associated with projects.
4+
5+
Migration strategy:
6+
- The primary key is `id`, which is unique and sufficient for migration.
7+
- Ensure foreign key references to `projects` are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212

313
from ._common import RefActions, column_created_datetime, column_modified_datetime

packages/postgres-database/src/simcore_postgres_database/models/projects_networks.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Projects networks table
2+
3+
- Represents networks associated with projects.
4+
5+
Migration strategy:
6+
- The primary key is `id`, which is unique and sufficient for migration.
7+
- Ensure foreign key references to `projects` are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212
from sqlalchemy.dialects.postgresql import JSONB
313

packages/postgres-database/src/simcore_postgres_database/models/projects_nodes.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
""" Groups table
1+
"""Projects nodes table
22
3-
- List of groups in the framework
4-
- Groups have a ID, name and a list of users that belong to the group
3+
- Represents nodes within projects.
4+
- List of groups in the framework
5+
- Groups have a ID, name and a list of users that belong to the group
6+
7+
Migration strategy:
8+
- The primary key is `node_id`, which is unique and sufficient for migration.
9+
- Ensure foreign key references to `projects` are valid in the target database.
10+
- No additional changes are required; this table can be migrated as is.
511
"""
612

713
import sqlalchemy as sa

packages/postgres-database/src/simcore_postgres_database/models/projects_tags.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Projects tags table
2+
3+
- Links tags to projects.
4+
5+
Migration strategy:
6+
- Composite primary key (`project_id`, `tag_id`) is unique and sufficient for migration.
7+
- Ensure foreign key references to `projects` and `tags` are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212

313
from ._common import RefActions

packages/postgres-database/src/simcore_postgres_database/models/projects_to_folders.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Projects to folders table
2+
3+
- Links projects to folders.
4+
5+
Migration strategy:
6+
- Composite primary key (`project_id`, `folder_id`) is unique and sufficient for migration.
7+
- Ensure foreign key references to `projects` and `folders` are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212

313
from ._common import RefActions, column_created_datetime, column_modified_datetime

packages/postgres-database/src/simcore_postgres_database/models/projects_to_products.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Projects to products table
2+
3+
- Links projects to products.
4+
5+
Migration strategy:
6+
- Composite primary key (`project_id`, `product_id`) is unique and sufficient for migration.
7+
- Ensure foreign key references to `projects` and `products` are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212

313
from ._common import RefActions, column_created_datetime, column_modified_datetime

packages/postgres-database/src/simcore_postgres_database/models/scicrunch_resources.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
""" Stores SOME of the information associated to Research Resource Identifiers (RRIDs) as defined in https://scicrunch.org/resources
1+
"""Scicrunch resources table
2+
3+
- Stores resources fetched from Scicrunch.
4+
- Stores SOME of the information associated to Research Resource Identifiers (RRIDs) as defined in https://scicrunch.org/resources
5+
6+
Migration strategy:
7+
- The primary key is `id`, which is unique and sufficient for migration.
8+
- No foreign key dependencies exist.
9+
- No additional changes are required; this table can be migrated as is.
10+
"""
11+
12+
"""
213
"""
314

415
import sqlalchemy as sa
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""Service compatibility table
2+
3+
- Defines compatibility between services.
4+
5+
Migration strategy:
6+
- Composite primary key (`service_key`, `service_version`) is unique and sufficient for migration.
7+
- Ensure foreign key references (if any) are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
11+
import sqlalchemy as sa
12+
from sqlalchemy.dialects.postgresql import JSONB
13+
14+
from .base import metadata
15+
16+
service_compatibility = sa.Table(
17+
"service_compatibility",
18+
metadata,
19+
sa.Column(
20+
"service_key",
21+
sa.String,
22+
nullable=False,
23+
doc="Service key identifier",
24+
),
25+
sa.Column(
26+
"service_version",
27+
sa.String,
28+
nullable=False,
29+
doc="Service version identifier",
30+
),
31+
sa.Column(
32+
"compatibility",
33+
JSONB,
34+
nullable=False,
35+
server_default=sa.text("'{}'::jsonb"),
36+
doc="Compatibility information in JSON format",
37+
),
38+
sa.PrimaryKeyConstraint("service_key", "service_version"),
39+
)

packages/postgres-database/src/simcore_postgres_database/models/services_consume_filetypes.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
"""
2-
Establishes which services can consume a given filetype
2+
Services consume filetypes table
33
4-
The relation is N-N because
5-
- a service could handle one or more filetypes and
6-
- one filetype could be handled by one or more services
4+
- Links services to the file types they consume.
5+
- Establishes which services can consume a given filetype
6+
- The relation is N-N because
7+
- a service could handle one or more filetypes and
8+
- one filetype could be handled by one or more services
9+
10+
Migration strategy:
11+
- Composite primary key (`service_key`, `filetype_id`) is unique and sufficient for migration.
12+
- Ensure foreign key references to `services` and `filetypes` are valid in the target database.
13+
- No additional changes are required; this table can be migrated as is.
714
"""
15+
816
import sqlalchemy as sa
917

1018
from ._common import RefActions
1119
from .base import metadata
1220

13-
#
14-
# TODO: This information SHALL be defined in service metadata upon publication
15-
# and the catalog service, using e.g. a background task,
16-
# can automatically fill this table with services that elligable (e.g. shared with everybody)
17-
# to consume given filetypes. Notice also that service "matching" will also be determined in a near
18-
# future by more complex metadata
19-
#
20-
2121
services_consume_filetypes = sa.Table(
2222
"services_consume_filetypes",
2323
metadata,

packages/postgres-database/src/simcore_postgres_database/models/tags.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Tags table
2+
3+
- Represents tags that can be associated with various entities.
4+
5+
Migration strategy:
6+
- The primary key is `id`, which is unique and sufficient for migration.
7+
- Ensure foreign key references (if any) are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212

313
from .base import metadata

packages/postgres-database/src/simcore_postgres_database/models/tags_access_rights.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Tags access rights table
2+
3+
- Defines access rights for tags.
4+
5+
Migration strategy:
6+
- Composite primary key (`tag_id`, `user_id`) is unique and sufficient for migration.
7+
- Ensure foreign key references to `tags` and `users` are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212

313
from ._common import RefActions, column_created_datetime, column_modified_datetime

packages/postgres-database/src/simcore_postgres_database/models/user_to_projects.py

-38
This file was deleted.

packages/postgres-database/src/simcore_postgres_database/models/users.py

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""Users table
2+
3+
- Represents users in the system.
4+
5+
Migration strategy:
6+
- The primary key is `id`, which is unique and sufficient for migration.
7+
- Ensure foreign key references (if any) are valid in the target database.
8+
- No additional changes are required; this table can be migrated as is.
9+
"""
10+
111
import sqlalchemy as sa
212
from common_library.users_enums import UserRole, UserStatus
313
from sqlalchemy.sql import expression
@@ -10,6 +20,7 @@
1020
"UserStatus",
1121
)
1222

23+
1324
users = sa.Table(
1425
"users",
1526
metadata,

0 commit comments

Comments
 (0)