internal/store/migrations/0058_profile_about_out.down.sql

4a511e42574ead9c92dc73fd320f296cc4dbea07
gitbay/internal/store/migrations/0058_profile_about_out.down.sql

20 lines · 990 bytes

 1ALTER TABLE users ADD COLUMN about TEXT NOT NULL DEFAULT '';
 2ALTER TABLE users ADD COLUMN about_format TEXT NOT NULL DEFAULT 'md';
 3ALTER TABLE orgs ADD COLUMN about TEXT NOT NULL DEFAULT '';
 4ALTER TABLE orgs ADD COLUMN about_format TEXT NOT NULL DEFAULT 'md';
 5
 6UPDATE users SET
 7  about = (SELECT about FROM profile_about_backfill
 8            WHERE owner_kind = 'user' AND owner_id = users.id),
 9  about_format = (SELECT about_format FROM profile_about_backfill
10            WHERE owner_kind = 'user' AND owner_id = users.id)
11  WHERE id IN (SELECT owner_id FROM profile_about_backfill WHERE owner_kind = 'user');
12
13UPDATE orgs SET
14  about = (SELECT about FROM profile_about_backfill
15            WHERE owner_kind = 'org' AND owner_id = orgs.id),
16  about_format = (SELECT about_format FROM profile_about_backfill
17            WHERE owner_kind = 'org' AND owner_id = orgs.id)
18  WHERE id IN (SELECT owner_id FROM profile_about_backfill WHERE owner_kind = 'org');
19
20DROP TABLE profile_about_backfill;
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form