Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
007cd48a
Commit
007cd48a
authored
7 years ago
by
Luke Barnard
Browse files
Options
Downloads
Patches
Plain Diff
Recreate groups table instead of adding column
Adding a column with non-constant default not possible in sqlite3
parent
713e60b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/schema/delta/46/group_server.sql
+16
-2
16 additions, 2 deletions
synapse/storage/schema/delta/46/group_server.sql
with
16 additions
and
2 deletions
synapse/storage/schema/delta/46/group_server.sql
+
16
−
2
View file @
007cd48a
...
...
@@ -13,6 +13,20 @@
* limitations under the License.
*/
-- whether non-members can access group APIs
CREATE
TABLE
groups_new
(
group_id
TEXT
NOT
NULL
,
name
TEXT
,
-- the display name of the room
avatar_url
TEXT
,
short_description
TEXT
,
long_description
TEXT
,
is_public
BOOL
NOT
NULL
-- whether non-members can access group APIs
);
-- NB: awful hack to get the default to be true on postgres and 1 on sqlite
ALTER
TABLE
groups
ADD
COLUMN
is_public
BOOL
DEFAULT
(
1
=
1
)
NOT
NULL
;
INSERT
INTO
groups_new
SELECT
group_id
,
name
,
avatar_url
,
short_description
,
long_description
,
(
1
=
1
)
FROM
groups
;
DROP
TABLE
groups
;
ALTER
TABLE
groups_new
RENAME
TO
groups
;
CREATE
UNIQUE
INDEX
groups_idx
ON
groups
(
group_id
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment