-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
[Feature] Allow admins to create an Organization. #99
Merged
Merged
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
92104e5
updated models
sinamics 6cb3123
new admin menu tab
sinamics 4872fc0
Merge branch 'main' into organization
sinamics b1f7b4e
org
sinamics c52ffd8
organization db model
sinamics ae17ca3
icon
sinamics 97290b3
header
sinamics 14be1b5
nav
sinamics 78ed609
fetch orgs
sinamics 124af6a
socket
sinamics 90ea9e2
Merge branch 'main' into organization
sinamics 1a22fac
trpc wss server
sinamics 6d3cadd
org network
sinamics 2fb757a
websocket
sinamics 52b94f8
update nextjs, next-intl websocket
sinamics 24f908e
change url path
sinamics 653f4f9
positioning
sinamics d93ca54
removed central beta
sinamics 9a19a84
lint
sinamics 139a6c5
org dashboard
sinamics ad2ca64
beta note
sinamics f5c264a
user activity log
sinamics 00796fe
logfooter
sinamics 96b64d6
chat icons
sinamics d96be6d
user color
sinamics 72cc802
logging
sinamics 4d6abdd
routing
sinamics f74d432
user invitation
sinamics 7439ef6
email template
sinamics a522eb4
leave org, modals, invite
sinamics fe6ea9e
org layout
sinamics d5ebf56
logging
sinamics b2c0513
sidebar active tab
sinamics 49e00bc
cascade when deleting a org.
sinamics c55c196
permissions
sinamics 1aae85c
descption
sinamics 1d2cc70
intl
sinamics 6f5e2da
new build
sinamics baa5941
update tests
sinamics a011f05
updated tests
sinamics d9f076a
test
sinamics cd6142e
modal
sinamics bfa817a
layout
sinamics d8a5d6d
layout
sinamics 02ffb4c
error message
sinamics 4d92507
org meta
sinamics 11a5c6b
org user edit
sinamics 0c820df
org id object
sinamics 6863f7c
add user description
sinamics 649c8d7
msg notification system
sinamics 1d12252
chat
sinamics 4cc69e8
lint
sinamics 6a9e713
remove NEXTAUTH_URL_INTERNAL
sinamics bf31716
lint
sinamics e7b98db
docs
sinamics 653ef97
crud network
sinamics d11ed9b
error handling
sinamics 47f9735
role
sinamics c4af2d3
permissions
sinamics 49676cf
permissions
sinamics 867fea2
translations
sinamics 40ca267
Merge branch 'main' into organization
sinamics c4dcb70
biome linting
sinamics cadc72b
translations
sinamics faa88cd
translations
sinamics c12fb92
org form
sinamics ba922bf
update prisma
sinamics cc04ab8
translations
sinamics 044c931
translations
sinamics 3f10d54
translations
sinamics 4542468
cascade logs
sinamics 3160911
delete network org id
sinamics bbfe514
scrollintoView
sinamics aa4c07f
translations
sinamics fde58d2
translations
sinamics 9208ff8
translations
sinamics cad36f0
lint
sinamics a549bf9
lint
sinamics fd4378e
translations
sinamics 0d0dedc
translations
sinamics File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 0 additions & 36 deletions
36
prisma/migrations/20230822195235_organization/migration.sql
This file was deleted.
Oops, something went wrong.
111 changes: 111 additions & 0 deletions
111
prisma/migrations/20231118160452_organization/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
-- AlterTable | ||
ALTER TABLE "network" ADD COLUMN "organizationId" TEXT; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Organization" ( | ||
"id" TEXT NOT NULL, | ||
"ownerId" TEXT NOT NULL, | ||
"orgName" TEXT NOT NULL, | ||
"description" TEXT, | ||
"isActive" BOOLEAN NOT NULL DEFAULT true, | ||
|
||
CONSTRAINT "Organization_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "UserOrganizationRole" ( | ||
"userId" TEXT NOT NULL, | ||
"organizationId" TEXT NOT NULL, | ||
"role" "Role" NOT NULL, | ||
|
||
CONSTRAINT "UserOrganizationRole_pkey" PRIMARY KEY ("userId","organizationId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "NetworkAccess" ( | ||
"userId" TEXT NOT NULL, | ||
"networkId" TEXT NOT NULL, | ||
"organizationId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "NetworkAccess_pkey" PRIMARY KEY ("userId","networkId","organizationId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "OrganizationSettings" ( | ||
"id" SERIAL NOT NULL, | ||
"organizationId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "OrganizationSettings_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "OrganizationInvitation" ( | ||
"id" SERIAL NOT NULL, | ||
"token" TEXT NOT NULL, | ||
"organizationId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "OrganizationInvitation_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "MembershipRequest" ( | ||
"id" SERIAL NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"organizationId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "MembershipRequest_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_MemberRelation" ( | ||
"A" TEXT NOT NULL, | ||
"B" TEXT NOT NULL | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "OrganizationSettings_organizationId_key" ON "OrganizationSettings"("organizationId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "OrganizationInvitation_token_key" ON "OrganizationInvitation"("token"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_MemberRelation_AB_unique" ON "_MemberRelation"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_MemberRelation_B_index" ON "_MemberRelation"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "network" ADD CONSTRAINT "network_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UserOrganizationRole" ADD CONSTRAINT "UserOrganizationRole_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UserOrganizationRole" ADD CONSTRAINT "UserOrganizationRole_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "NetworkAccess" ADD CONSTRAINT "NetworkAccess_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "NetworkAccess" ADD CONSTRAINT "NetworkAccess_networkId_fkey" FOREIGN KEY ("networkId") REFERENCES "network"("nwid") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "NetworkAccess" ADD CONSTRAINT "NetworkAccess_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "OrganizationSettings" ADD CONSTRAINT "OrganizationSettings_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "OrganizationInvitation" ADD CONSTRAINT "OrganizationInvitation_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "MembershipRequest" ADD CONSTRAINT "MembershipRequest_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "MembershipRequest" ADD CONSTRAINT "MembershipRequest_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_MemberRelation" ADD CONSTRAINT "_MemberRelation_A_fkey" FOREIGN KEY ("A") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_MemberRelation" ADD CONSTRAINT "_MemberRelation_B_fkey" FOREIGN KEY ("B") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean "Organization"? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but these hardcoded text is just kinda placeholders. All text will be added to the translation files later with correct spelling. :)