Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Trash workspaces #6690

Merged
merged 54 commits into from
Nov 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
99104eb
exc handlers
pcrespov Nov 8, 2024
4b0071d
exc handlers in workspaces
pcrespov Nov 8, 2024
3586430
separates models
pcrespov Nov 8, 2024
bf3b67c
updates oas builder
pcrespov Nov 8, 2024
4886caa
updates OAS
pcrespov Nov 8, 2024
39b8d4b
services/webserver api version: 0.45.0 → 0.46.0
pcrespov Nov 8, 2024
f94ab75
drafts trash section
pcrespov Nov 8, 2024
cc35618
updates oas
pcrespov Nov 12, 2024
0e5ddb0
minor
pcrespov Nov 12, 2024
b22adaf
adds db
pcrespov Nov 12, 2024
3e788bd
db models
pcrespov Nov 12, 2024
c4310b9
migration
pcrespov Nov 12, 2024
44d56be
common model
pcrespov Nov 12, 2024
8ee93da
cleanup
pcrespov Nov 12, 2024
e0a3113
models
pcrespov Nov 14, 2024
bac1ac6
workspaces query
pcrespov Nov 14, 2024
33cbd9d
rest ordering
pcrespov Nov 14, 2024
6db1ea7
base rest
pcrespov Nov 14, 2024
21aa58d
cleanup api
pcrespov Nov 18, 2024
716fe6f
openapi
pcrespov Nov 18, 2024
7e42e9f
updates oas
pcrespov Nov 18, 2024
be372fb
updates OAS
pcrespov Nov 18, 2024
141c759
updates migration
pcrespov Nov 18, 2024
8e65a1a
folders
pcrespov Nov 20, 2024
6431182
workspaces query
pcrespov Nov 20, 2024
2070135
workspaces query
pcrespov Nov 20, 2024
1cca757
clenup
pcrespov Nov 20, 2024
4484c54
implements WorkspaceGet w/ trash attributes
pcrespov Nov 20, 2024
cca0c1a
oas
pcrespov Nov 20, 2024
3453127
cleanup
pcrespov Nov 20, 2024
f040534
cleanup test
pcrespov Nov 20, 2024
998966c
cleanup tests
pcrespov Nov 20, 2024
66ef145
workspaces new list
pcrespov Nov 20, 2024
61d86e9
drafted tests
pcrespov Nov 20, 2024
93edb80
workspace update
pcrespov Nov 20, 2024
eba0877
adds trash empty workspace
pcrespov Nov 20, 2024
f4b47ac
fixes tests
pcrespov Nov 20, 2024
fee23e5
fixes mypy
pcrespov Nov 20, 2024
be91874
update OAS
pcrespov Nov 20, 2024
4823061
sonar
pcrespov Nov 20, 2024
a2a466c
fixes migration
pcrespov Nov 20, 2024
2a60b99
undos
pcrespov Nov 20, 2024
dbba633
readme
pcrespov Nov 20, 2024
af843e5
udno
pcrespov Nov 20, 2024
018ad58
path
pcrespov Nov 20, 2024
5d30429
cleanup
pcrespov Nov 20, 2024
567075e
rm badges
pcrespov Nov 20, 2024
75964f9
fixes testss
pcrespov Nov 20, 2024
5194888
Merge branch 'master' into is468/trash-api-workspaces
pcrespov Nov 21, 2024
b20528b
minor
pcrespov Nov 21, 2024
737f7ae
updates pg
pcrespov Nov 21, 2024
966980a
minor
pcrespov Nov 21, 2024
ff9777a
Merge branch 'master' into is468/trash-api-workspaces
pcrespov Nov 23, 2024
b373a4b
cleanup
pcrespov Nov 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes migration
  • Loading branch information
pcrespov committed Nov 20, 2024
commit a2a466ccb3a23cd1c1a6dfbe3ab67e04574d8aa8
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""trash columns in workspaces

Revision ID: aff5aa99ee3c
Revision ID: c9db8bf5091e
Revises: 8e1f83486be7
Create Date: 2024-11-20 13:27:26.677261+00:00
Create Date: 2024-11-20 16:42:43.784855+00:00

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "aff5aa99ee3c"
revision = "c9db8bf5091e"
down_revision = "8e1f83486be7"
branch_labels = None
depends_on = None
@@ -36,7 +36,7 @@ def upgrade():
),
)
op.create_foreign_key(
None,
"fk_workspace_trashed_by_user_id",
"workspaces",
"users",
["trashed_by"],
@@ -49,7 +49,9 @@ def upgrade():

def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "workspaces", type_="foreignkey")
op.drop_constraint(
"fk_workspace_trashed_by_user_id", "workspaces", type_="foreignkey"
)
op.drop_column("workspaces", "trashed_by")
op.drop_column("workspaces", "trashed")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from enum import Enum
from typing import Final

import sqlalchemy as sa

from ..constants import DECIMAL_PLACES


class ReferentialAction(str, Enum):
class ReferentialAction:
# SEE https://docs.sqlalchemy.org/en/20/orm/cascades.html
CASCADE = "CASCADE"
SET_NULL = "SET NULL"
@@ -86,6 +85,7 @@ def column_trashed_by_user(resource_name: str, users_table: sa.Table) -> sa.Colu
users_table.c.id,
onupdate=ReferentialAction.CASCADE,
ondelete=ReferentialAction.SET_NULL,
name=f"fk_{resource_name}_trashed_by_user_id",
),
nullable=True,
comment=f"User who trashed the {resource_name}, or null if not trashed or user is unknown.",