UserPermission and GroupPermission models (#5860)

* fix: rename to group_permissions

* fix: delete null collectionId records before setting non null constraint

* fix: use scope with collectionId not null

* fix: update model with documentId

* fix: rename to GroupPermission

* fix: rename collection_users to user_permissions

* fix: teamPermanentDeleter test

* fix: use scope with collectionId not null

* fix: update model with documentId

* fix: rename to UserPermission

* fix: create views upon table rename for zero downtime

* fix: remove comments
This commit is contained in:
Apoorv Mishra
2023-09-25 10:51:29 +05:30
committed by GitHub
parent 43bdb97639
commit 7145f7ef51
22 changed files with 558 additions and 123 deletions

View File

@@ -1,5 +1,5 @@
import { CollectionPermission } from "@shared/types";
import { View, CollectionUser } from "@server/models";
import { View, UserPermission } from "@server/models";
import {
buildAdmin,
buildCollection,
@@ -71,7 +71,7 @@ describe("#views.list", () => {
});
collection.permission = null;
await collection.save();
await CollectionUser.create({
await UserPermission.create({
createdById: user.id,
collectionId: collection.id,
userId: user.id,
@@ -150,7 +150,7 @@ describe("#views.create", () => {
});
collection.permission = null;
await collection.save();
await CollectionUser.create({
await UserPermission.create({
createdById: user.id,
collectionId: collection.id,
userId: user.id,