Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/sql/30-schema.sql
--- | --- | ||||
--- Software Heritage Indexers Data Model | --- Software Heritage Indexers Data Model | ||||
--- | --- | ||||
-- drop schema if exists swh cascade; | -- drop schema if exists swh cascade; | ||||
-- create schema swh; | -- create schema swh; | ||||
-- set search_path to swh; | -- set search_path to swh; | ||||
create table dbversion | create table dbversion | ||||
( | ( | ||||
version int primary key, | version int primary key, | ||||
release timestamptz, | release timestamptz, | ||||
description text | description text | ||||
); | ); | ||||
insert into dbversion(version, release, description) | insert into dbversion(version, release, description) | ||||
values(132, now(), 'Work In Progress'); | values(133, now(), 'Work In Progress'); | ||||
-- Computing metadata on sha1's contents | -- Computing metadata on sha1's contents | ||||
-- a SHA1 checksum (not necessarily originating from Git) | -- a SHA1 checksum (not necessarily originating from Git) | ||||
create domain sha1 as bytea check (length(value) = 20); | create domain sha1 as bytea check (length(value) = 20); | ||||
-- a Git object ID, i.e., a SHA1 checksum | -- a Git object ID, i.e., a SHA1 checksum | ||||
create domain sha1_git as bytea check (length(value) = 20); | create domain sha1_git as bytea check (length(value) = 20); | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |