Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6b0aa57

Browse files
committed
feat: implement 'is_default' org field
The first organization created is now marked as "default". This isto allow "single org" behavior as we move to a multi org codebase.It is intentional that the user cannot change the default org at thisstage. Only 1 default org can exist, and it is always the first org.
1 parent2bf2f88 commit6b0aa57

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DROPINDEX organizations_single_default_org;
2+
ALTERTABLE organizations DROP COLUMN is_default;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- This migration is intended to maintain the existing behavior of single org
2+
-- deployments, while allowing for multi-org deployments. By default, this organization
3+
-- will be used when no organization is specified.
4+
ALTERTABLE organizations ADD COLUMN is_defaultBOOLEANNOT NULL DEFAULT FALSE;
5+
6+
-- Only 1 org should ever be set to is_default.
7+
createunique indexorganizations_single_default_orgon organizations (is_default)
8+
where is_default= true;
9+
10+
UPDATE
11+
organizations
12+
SET
13+
is_default= true
14+
WHERE
15+
-- The first organization created will be the default.
16+
id= (SELECT idFROM organizationsORDER BYorganizations.created_atASCLIMIT1 );

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp