Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/schema.py
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | CREATE TABLE IF NOT EXISTS raw_extrinsic_metadata ( | ||||
-- <=> (target1, ..., date1, id1) < (target2, ..., date2, id2) | -- <=> (target1, ..., date1, id1) < (target2, ..., date2, id2) | ||||
-- | -- | ||||
-- b) the id is a hash of all the columns, so: | -- b) the id is a hash of all the columns, so: | ||||
-- rows are the same | -- rows are the same | ||||
-- <=> id1 == id2 | -- <=> id1 == id2 | ||||
-- <=> (target1, ..., date1, id1) == (target2, ..., date2, id2) | -- <=> (target1, ..., date1, id1) == (target2, ..., date2, id2) | ||||
);""", | );""", | ||||
""" | """ | ||||
CREATE TABLE IF NOT EXISTS raw_extrinsic_metadata_by_id ( | |||||
id blob, | |||||
target text, | |||||
authority_type text, | |||||
authority_url text, | |||||
PRIMARY KEY ((id)) | |||||
);""", | |||||
""" | |||||
CREATE TABLE IF NOT EXISTS object_count ( | CREATE TABLE IF NOT EXISTS object_count ( | ||||
partition_key smallint, -- Constant, must always be 0 | partition_key smallint, -- Constant, must always be 0 | ||||
object_type ascii, | object_type ascii, | ||||
count counter, | count counter, | ||||
PRIMARY KEY ((partition_key), object_type) | PRIMARY KEY ((partition_key), object_type) | ||||
);""", | );""", | ||||
""" | """ | ||||
CREATE TABLE IF NOT EXISTS extid ( | CREATE TABLE IF NOT EXISTS extid ( | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |