Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9313891
171.sql
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
758 B
Subscribers
None
171.sql
View Options
-- SWH DB schema upgrade
-- from_version: 170
-- to_version: 171
-- description: add raw_extrinsic_metadata.id
insert
into
dbversion
(
version
,
release
,
description
)
values
(
171
,
now
(),
'Work In Progress'
);
-- 1. add the 'id' column
alter
table
raw_extrinsic_metadata
add
column
id
sha1_git
;
-- 2. restart swh-storage, so that it starts writing the id (but does not read it)
-- 3. truncate the raw_extrinsic_metadata table
-- 4. make the id column not null, and index it
alter
table
raw_extrinsic_metadata
alter
column
id
set
not
null
;
create
unique
index
concurrently
raw_extrinsic_metadata_pkey
on
raw_extrinsic_metadata
(
id
);
alter
table
raw_extrinsic_metadata
add
primary
key
using
index
raw_extrinsic_metadata_pkey
;
-- 5. backfill from kafka
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 12:00 PM (2 d, 21 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3294535
Attached To
rDSTO Storage manager
Event Timeline
Log In to Comment