Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/schema.py
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
else: | else: | ||||
assert False, f"{UDF_LANGUAGE} must be 'lua' or 'java'" | assert False, f"{UDF_LANGUAGE} must be 'lua' or 'java'" | ||||
CREATE_TABLES_QUERIES = [ | CREATE_TABLES_QUERIES = [ | ||||
*CREATE_TABLES_QUERIES, | *CREATE_TABLES_QUERIES, | ||||
""" | """ | ||||
CREATE TYPE IF NOT EXISTS microtimestamp ( | CREATE TYPE IF NOT EXISTS microtimestamp ( | ||||
seconds bigint, | seconds bigint, | ||||
microseconds int | microseconds int, | ||||
);""", | );""", | ||||
""" | """ | ||||
CREATE TYPE IF NOT EXISTS microtimestamp_with_timezone ( | CREATE TYPE IF NOT EXISTS microtimestamp_with_timezone ( | ||||
timestamp frozen<microtimestamp>, | timestamp frozen<microtimestamp>, | ||||
offset smallint, | offset smallint, | ||||
negative_utc boolean | negative_utc boolean, | ||||
offset_bytes blob, | |||||
);""", | );""", | ||||
""" | """ | ||||
CREATE TYPE IF NOT EXISTS person ( | CREATE TYPE IF NOT EXISTS person ( | ||||
fullname blob, | fullname blob, | ||||
name blob, | name blob, | ||||
email blob | email blob | ||||
);""", | );""", | ||||
""" | """ | ||||
Show All 31 Lines | CREATE TABLE IF NOT EXISTS revision ( | ||||
directory blob, -- source code "root" directory | directory blob, -- source code "root" directory | ||||
message blob, | message blob, | ||||
author person, | author person, | ||||
committer person, | committer person, | ||||
synthetic boolean, | synthetic boolean, | ||||
-- true iff revision has been created by Software Heritage | -- true iff revision has been created by Software Heritage | ||||
metadata text, | metadata text, | ||||
-- extra metadata as JSON(tarball checksums, etc...) | -- extra metadata as JSON(tarball checksums, etc...) | ||||
extra_headers frozen<list <list<blob>> > | extra_headers frozen<list <list<blob>> >, | ||||
-- extra commit information as (tuple(key, value), ...) | -- extra commit information as (tuple(key, value), ...) | ||||
raw_manifest blob, | |||||
-- NULL if the object can be rebuild from other cells and revision_parent. | |||||
);""", | );""", | ||||
""" | """ | ||||
CREATE TABLE IF NOT EXISTS revision_parent ( | CREATE TABLE IF NOT EXISTS revision_parent ( | ||||
id blob, | id blob, | ||||
parent_rank int, | parent_rank int, | ||||
-- parent position in merge commits, 0-based | -- parent position in merge commits, 0-based | ||||
parent_id blob, | parent_id blob, | ||||
PRIMARY KEY ((id), parent_rank) | PRIMARY KEY ((id), parent_rank) | ||||
);""", | );""", | ||||
""" | """ | ||||
CREATE TABLE IF NOT EXISTS release | CREATE TABLE IF NOT EXISTS release | ||||
( | ( | ||||
id blob PRIMARY KEY, | id blob PRIMARY KEY, | ||||
target_type ascii, | target_type ascii, | ||||
target blob, | target blob, | ||||
date microtimestamp_with_timezone, | date microtimestamp_with_timezone, | ||||
name blob, | name blob, | ||||
message blob, | message blob, | ||||
author person, | author person, | ||||
synthetic boolean, | synthetic boolean, | ||||
-- true iff release has been created by Software Heritage | -- true iff release has been created by Software Heritage | ||||
raw_manifest blob, | |||||
-- NULL if the object can be rebuild from other cells | |||||
);""", | );""", | ||||
""" | """ | ||||
CREATE TABLE IF NOT EXISTS directory ( | CREATE TABLE IF NOT EXISTS directory ( | ||||
id blob PRIMARY KEY, | id blob PRIMARY KEY, | ||||
raw_manifest blob | |||||
-- NULL if the object can be rebuild from (sorted) entries | |||||
);""", | );""", | ||||
""" | """ | ||||
CREATE TABLE IF NOT EXISTS directory_entry ( | CREATE TABLE IF NOT EXISTS directory_entry ( | ||||
directory_id blob, | directory_id blob, | ||||
name blob, -- path name, relative to containing dir | name blob, -- path name, relative to containing dir | ||||
target blob, | target blob, | ||||
perms int, -- unix-like permissions | perms int, -- unix-like permissions | ||||
type ascii, -- target type | type ascii, -- target type | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |