-- store the next dir to lookup the next local path from
res[i+1] := r.target;
end if;
end loop;
-- at this moment, r is the result. Patch its 'name' with the full path before returning it.
r.name := paths;
return r;
end
$$;
ALTER FUNCTION public.swh_find_directory_entry_by_path(walked_dir_id public.sha1_git, dir_or_content_path bytea[]) OWNER TO tony;
--
-- Name: swh_mktemp(regclass); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp(tblname regclass) RETURNS void
LANGUAGE plpgsql
AS $_$
begin
execute format('
create temporary table tmp_%1$I
(like %1$I including defaults)
on commit drop;
alter table tmp_%1$I drop column if exists object_id;
', tblname);
return;
end
$_$;
ALTER FUNCTION public.swh_mktemp(tblname regclass) OWNER TO tony;
--
-- Name: swh_mktemp_bytea(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_bytea() RETURNS void
LANGUAGE sql
AS $$
create temporary table tmp_bytea (
id bytea
) on commit drop;
$$;
ALTER FUNCTION public.swh_mktemp_bytea() OWNER TO tony;
--
-- Name: swh_mktemp_dir_entry(regclass); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_dir_entry(tblname regclass) RETURNS void
LANGUAGE plpgsql
AS $_$
begin
execute format('
create temporary table tmp_%1$I
(like %1$I including defaults, dir_id sha1_git)
on commit drop;
alter table tmp_%1$I drop column id;
', tblname);
return;
end
$_$;
ALTER FUNCTION public.swh_mktemp_dir_entry(tblname regclass) OWNER TO tony;
--
-- Name: swh_mktemp_entity_history(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_entity_history() RETURNS void
LANGUAGE sql
AS $$
create temporary table tmp_entity_history (
like entity_history including defaults) on commit drop;
alter table tmp_entity_history drop column id;
$$;
ALTER FUNCTION public.swh_mktemp_entity_history() OWNER TO tony;
--
-- Name: swh_mktemp_entity_lister(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_entity_lister() RETURNS void
LANGUAGE sql
AS $$
create temporary table tmp_entity_lister (
id bigint,
lister_metadata jsonb
) on commit drop;
$$;
ALTER FUNCTION public.swh_mktemp_entity_lister() OWNER TO tony;
--
-- Name: swh_mktemp_occurrence_history(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_occurrence_history() RETURNS void
LANGUAGE sql
AS $$
create temporary table tmp_occurrence_history(
like occurrence_history including defaults,
visit bigint not null
) on commit drop;
alter table tmp_occurrence_history
drop column visits,
drop column object_id;
$$;
ALTER FUNCTION public.swh_mktemp_occurrence_history() OWNER TO tony;
--
-- Name: swh_mktemp_release(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_release() RETURNS void
LANGUAGE sql
AS $$
create temporary table tmp_release (
like release including defaults,
author_fullname bytea,
author_name bytea,
author_email bytea
) on commit drop;
alter table tmp_release drop column author;
alter table tmp_release drop column object_id;
$$;
ALTER FUNCTION public.swh_mktemp_release() OWNER TO tony;
--
-- Name: swh_mktemp_revision(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_revision() RETURNS void
LANGUAGE sql
AS $$
create temporary table tmp_revision (
like revision including defaults,
author_fullname bytea,
author_name bytea,
author_email bytea,
committer_fullname bytea,
committer_name bytea,
committer_email bytea
) on commit drop;
alter table tmp_revision drop column author;
alter table tmp_revision drop column committer;
alter table tmp_revision drop column object_id;
$$;
ALTER FUNCTION public.swh_mktemp_revision() OWNER TO tony;
--
-- Name: swh_mktemp_snapshot_branch(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_snapshot_branch() RETURNS void
LANGUAGE sql
AS $$
create temporary table tmp_snapshot_branch (
name bytea not null,
target bytea,
target_type snapshot_target
) on commit drop;
$$;
ALTER FUNCTION public.swh_mktemp_snapshot_branch() OWNER TO tony;
--
-- Name: swh_mktemp_tool(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_mktemp_tool() RETURNS void
LANGUAGE sql
AS $$
create temporary table tmp_tool (
like tool including defaults
) on commit drop;
alter table tmp_tool drop column id;
$$;
ALTER FUNCTION public.swh_mktemp_tool() OWNER TO tony;
--
-- Name: swh_object_find_by_sha1_git(); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_object_find_by_sha1_git() RETURNS SETOF public.object_found
LANGUAGE plpgsql
AS $$
begin
return query
with known_objects as ((
select id as sha1_git, 'release'::object_type as type, id, object_id from release r
where exists (select 1 from tmp_bytea t where t.id = r.id)
) union all (
select id as sha1_git, 'revision'::object_type as type, id, object_id from revision r
where exists (select 1 from tmp_bytea t where t.id = r.id)
) union all (
select id as sha1_git, 'directory'::object_type as type, id, object_id from directory d
where exists (select 1 from tmp_bytea t where t.id = d.id)
) union all (
select sha1_git as sha1_git, 'content'::object_type as type, sha1 as id, object_id from content c
where exists (select 1 from tmp_bytea t where t.id = c.sha1_git)
))
select t.id::sha1_git as sha1_git, k.type, k.id, k.object_id from tmp_bytea t
left join known_objects k on t.id = k.sha1_git;
end
$$;
ALTER FUNCTION public.swh_object_find_by_sha1_git() OWNER TO tony;
--
-- Name: occurrence; Type: TABLE; Schema: public; Owner: tony
--
CREATE TABLE public.occurrence (
origin bigint NOT NULL,
branch bytea NOT NULL,
target public.sha1_git NOT NULL,
target_type public.object_type NOT NULL
);
ALTER TABLE public.occurrence OWNER TO tony;
--
-- Name: swh_occurrence_by_origin_visit(bigint, bigint); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_occurrence_by_origin_visit(origin_id bigint, visit_id bigint) RETURNS SETOF public.occurrence
LANGUAGE sql STABLE
AS $$
select origin, branch, target, target_type from occurrence_history
where origin = origin_id and visit_id = ANY(visits);
$$;
ALTER FUNCTION public.swh_occurrence_by_origin_visit(origin_id bigint, visit_id bigint) OWNER TO tony;
--
-- Name: occurrence_history; Type: TABLE; Schema: public; Owner: tony
--
CREATE TABLE public.occurrence_history (
origin bigint NOT NULL,
branch bytea NOT NULL,
target public.sha1_git NOT NULL,
target_type public.object_type NOT NULL,
visits bigint[] NOT NULL,
object_id bigint NOT NULL,
snapshot_branch_id bigint
);
ALTER TABLE public.occurrence_history OWNER TO tony;
--
-- Name: swh_occurrence_get_by(bigint, bytea, timestamp with time zone); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_occurrence_get_by(origin_id bigint, branch_name bytea DEFAULT NULL::bytea, date timestamp with time zone DEFAULT NULL::timestamp with time zone) RETURNS SETOF public.occurrence_history
LANGUAGE plpgsql
AS $$
declare
filters text[] := array[] :: text[]; -- AND-clauses used to filter content
visit_id bigint;
q text;
begin
if origin_id is null then
raise exception 'Needs an origin_id to get an occurrence.';
array(select rh.parent_id::bytea from revision_history rh where rh.id = t.id order by rh.parent_rank)
as parents, r.object_id
from tmp_bytea t
left join revision r on t.id = r.id
left join person a on a.id = r.author
left join person c on c.id = r.committer;
return;
end
$$;
ALTER FUNCTION public.swh_revision_get() OWNER TO tony;
--
-- Name: swh_revision_get_by(bigint, bytea, timestamp with time zone); Type: FUNCTION; Schema: public; Owner: tony
--
CREATE FUNCTION public.swh_revision_get_by(origin_id bigint, branch_name bytea DEFAULT NULL::bytea, date timestamp with time zone DEFAULT NULL::timestamp with time zone) RETURNS SETOF public.revision_entry
5f4d4c51-498a-4e28-88b3-b3e4e8396cba \N softwareheritage organization Software Heritage http://www.softwareheritage.org/ t f \N \N 2018-03-14 12:11:23.131312+01 1
6577984d-64c8-4fab-b3ea-3cf63ebb8589 \N gnu organization GNU is not UNIX https://gnu.org/ t f \N \N 2018-03-14 12:11:23.131312+01 2
7c33636b-8f11-4bda-89d9-ba8b76a42cec 6577984d-64c8-4fab-b3ea-3cf63ebb8589 GNU Hosting group_of_entities GNU Hosting facilities \N t f \N \N 2018-03-14 12:11:23.131312+01 3
4706c92a-8173-45d9-93d7-06523f249398 6577984d-64c8-4fab-b3ea-3cf63ebb8589 GNU rsync mirror hosting GNU rsync mirror rsync://mirror.gnu.org/ t f \N \N 2018-03-14 12:11:23.131312+01 4
5cb20137-c052-4097-b7e9-e1020172c48e 6577984d-64c8-4fab-b3ea-3cf63ebb8589 GNU Projects group_of_entities GNU Projects https://gnu.org/software/ t f \N \N 2018-03-14 12:11:23.131312+01 5
4bfb38f6-f8cd-4bc2-b256-5db689bb8da4 \N GitHub organization GitHub https://github.org/ t f \N \N 2018-03-14 12:11:23.131312+01 6
aee991a0-f8d7-4295-a201-d1ce2efc9fb2 4bfb38f6-f8cd-4bc2-b256-5db689bb8da4 GitHub Hosting group_of_entities GitHub Hosting facilities https://github.org/ t f \N \N 2018-03-14 12:11:23.131312+01 7
34bd6b1b-463f-43e5-a697-785107f598e4 aee991a0-f8d7-4295-a201-d1ce2efc9fb2 GitHub git hosting hosting GitHub git hosting https://github.org/ t f \N \N 2018-03-14 12:11:23.131312+01 8
e8c3fc2e-a932-4fd7-8f8e-c40645eb35a7 aee991a0-f8d7-4295-a201-d1ce2efc9fb2 GitHub asset hosting hosting GitHub asset hosting https://github.org/ t f \N \N 2018-03-14 12:11:23.131312+01 9
9f7b34d9-aa98-44d4-8907-b332c1036bc3 4bfb38f6-f8cd-4bc2-b256-5db689bb8da4 GitHub Organizations group_of_entities GitHub Organizations https://github.org/ t f \N \N 2018-03-14 12:11:23.131312+01 10
ad6df473-c1d2-4f40-bc58-2b091d4a750e 4bfb38f6-f8cd-4bc2-b256-5db689bb8da4 GitHub Users group_of_entities GitHub Users https://github.org/ t f \N \N 2018-03-14 12:11:23.131312+01 11
\.
--
-- Data for Name: entity_equivalence; Type: TABLE DATA; Schema: public; Owner: tony
--
COPY public.entity_equivalence (entity1, entity2) FROM stdin;
\.
--
-- Data for Name: entity_history; Type: TABLE DATA; Schema: public; Owner: tony
1 5f4d4c51-498a-4e28-88b3-b3e4e8396cba \N softwareheritage organization Software Heritage http://www.softwareheritage.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
2 6577984d-64c8-4fab-b3ea-3cf63ebb8589 \N gnu organization GNU is not UNIX https://gnu.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
3 7c33636b-8f11-4bda-89d9-ba8b76a42cec 6577984d-64c8-4fab-b3ea-3cf63ebb8589 GNU Hosting group_of_entities GNU Hosting facilities \N t f \N \N {"2018-03-14 12:11:23.131312+01"}
4 4706c92a-8173-45d9-93d7-06523f249398 6577984d-64c8-4fab-b3ea-3cf63ebb8589 GNU rsync mirror hosting GNU rsync mirror rsync://mirror.gnu.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
5 5cb20137-c052-4097-b7e9-e1020172c48e 6577984d-64c8-4fab-b3ea-3cf63ebb8589 GNU Projects group_of_entities GNU Projects https://gnu.org/software/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
6 4bfb38f6-f8cd-4bc2-b256-5db689bb8da4 \N GitHub organization GitHub https://github.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
7 aee991a0-f8d7-4295-a201-d1ce2efc9fb2 4bfb38f6-f8cd-4bc2-b256-5db689bb8da4 GitHub Hosting group_of_entities GitHub Hosting facilities https://github.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
8 34bd6b1b-463f-43e5-a697-785107f598e4 aee991a0-f8d7-4295-a201-d1ce2efc9fb2 GitHub git hosting hosting GitHub git hosting https://github.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
9 e8c3fc2e-a932-4fd7-8f8e-c40645eb35a7 aee991a0-f8d7-4295-a201-d1ce2efc9fb2 GitHub asset hosting hosting GitHub asset hosting https://github.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
10 9f7b34d9-aa98-44d4-8907-b332c1036bc3 4bfb38f6-f8cd-4bc2-b256-5db689bb8da4 GitHub Organizations group_of_entities GitHub Organizations https://github.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
11 ad6df473-c1d2-4f40-bc58-2b091d4a750e 4bfb38f6-f8cd-4bc2-b256-5db689bb8da4 GitHub Users group_of_entities GitHub Users https://github.org/ t f \N \N {"2018-03-14 12:11:23.131312+01"}
\.
--
-- Data for Name: fetch_history; Type: TABLE DATA; Schema: public; Owner: tony
1 1 2018-03-14 12:11:47.017402+01 f \N \N Traceback (most recent call last):\n File "/home/tony/work/inria/repo/swh/swh-environment/swh-loader-core/swh/loader/core/loader.py", line 889, in load\n more_data_to_fetch = self.fetch_data()\n File "/home/tony/work/inria/repo/swh/swh-environment/swh-loader-git/swh/loader/git/updater.py", line 284, in fetch_data\n self.pack_size)\n File "/home/tony/work/inria/repo/swh/swh-environment/swh-loader-git/swh/loader/git/updater.py", line 229, in list_pack\n inflater = self.get_inflater()\n File "/home/tony/work/inria/repo/swh/swh-environment/swh-loader-git/swh/loader/git/updater.py", line 314, in get_inflater\n PackData.from_file(self.pack_buffer, self.pack_size))\n File "/usr/lib/python3/dist-packages/dulwich/pack.py", line 1277, in for_pack_data\n for unpacked in pack_data._iter_unpacked():\n File "/usr/lib/python3/dist-packages/dulwich/pack.py", line 1141, in _iter_unpacked\n self._file.read, compute_crc32=False)\n File "/usr/lib/python3/dist-packages/dulwich/pack.py", line 737, in unpack_object\n include_comp=include_comp)\n File "/usr/lib/python3/dist-packages/dulwich/pack.py", line 232, in read_zlib_chunks\n decomp = decomp_obj.decompress(add)\nzlib.error: Error -3 while decompressing data: incorrect data check\n 00:00:33.001641
-- Name: tool tool_pkey; Type: CONSTRAINT; Schema: public; Owner: tony
--
ALTER TABLE ONLY public.tool
ADD CONSTRAINT tool_pkey PRIMARY KEY (id);
--
-- Name: content_blake2s256_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX content_blake2s256_idx ON public.content USING btree (blake2s256);
--
-- Name: content_ctime_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX content_ctime_idx ON public.content USING btree (ctime);
--
-- Name: content_object_id_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX content_object_id_idx ON public.content USING btree (object_id);
--
-- Name: content_sha1_git_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX content_sha1_git_idx ON public.content USING btree (sha1_git);
--
-- Name: content_sha256_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX content_sha256_idx ON public.content USING btree (sha256);
--
-- Name: directory_dir_entries_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX directory_dir_entries_idx ON public.directory USING gin (dir_entries);
--
-- Name: directory_entry_dir_target_name_perms_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX directory_entry_dir_target_name_perms_idx ON public.directory_entry_dir USING btree (target, name, perms);
--
-- Name: directory_entry_file_target_name_perms_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX directory_entry_file_target_name_perms_idx ON public.directory_entry_file USING btree (target, name, perms);
--
-- Name: directory_entry_rev_target_name_perms_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX directory_entry_rev_target_name_perms_idx ON public.directory_entry_rev USING btree (target, name, perms);
--
-- Name: directory_file_entries_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX directory_file_entries_idx ON public.directory USING gin (file_entries);
--
-- Name: directory_object_id_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX directory_object_id_idx ON public.directory USING btree (object_id);
--
-- Name: directory_rev_entries_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX directory_rev_entries_idx ON public.directory USING gin (rev_entries);
--
-- Name: entity_history_name_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX entity_history_name_idx ON public.entity_history USING btree (name);
--
-- Name: entity_history_uuid_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX entity_history_uuid_idx ON public.entity_history USING btree (uuid);
--
-- Name: entity_lister_metadata_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX entity_lister_metadata_idx ON public.entity USING gin (lister_metadata jsonb_path_ops);
--
-- Name: entity_name_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX entity_name_idx ON public.entity USING btree (name);
--
-- Name: metadata_provider_provider_name_provider_url_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX metadata_provider_provider_name_provider_url_idx ON public.metadata_provider USING btree (provider_name, provider_url);
--
-- Name: occurrence_history_origin_branch_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX occurrence_history_origin_branch_idx ON public.occurrence_history USING btree (origin, branch);
--
-- Name: occurrence_history_origin_branch_target_target_type_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX occurrence_history_origin_branch_target_target_type_idx ON public.occurrence_history USING btree (origin, branch, target, target_type);
--
-- Name: occurrence_history_target_target_type_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX occurrence_history_target_target_type_idx ON public.occurrence_history USING btree (target, target_type);
--
-- Name: origin_metadata_origin_id_provider_id_tool_id_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX origin_metadata_origin_id_provider_id_tool_id_idx ON public.origin_metadata USING btree (origin_id, provider_id, tool_id);
--
-- Name: origin_type_url_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX origin_type_url_idx ON public.origin USING btree (type, url);
--
-- Name: origin_visit_date_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX origin_visit_date_idx ON public.origin_visit USING btree (date);
--
-- Name: person_email_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX person_email_idx ON public.person USING btree (email);
--
-- Name: person_fullname_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX person_fullname_idx ON public.person USING btree (fullname);
--
-- Name: person_name_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX person_name_idx ON public.person USING btree (name);
--
-- Name: release_object_id_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX release_object_id_idx ON public.release USING btree (object_id);
--
-- Name: release_target_target_type_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX release_target_target_type_idx ON public.release USING btree (target, target_type);
--
-- Name: revision_directory_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX revision_directory_idx ON public.revision USING btree (directory);
--
-- Name: revision_history_parent_id_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX revision_history_parent_id_idx ON public.revision_history USING btree (parent_id);
--
-- Name: revision_object_id_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX revision_object_id_idx ON public.revision USING btree (object_id);
--
-- Name: skipped_content_blake2s256_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX skipped_content_blake2s256_idx ON public.skipped_content USING btree (blake2s256);
--
-- Name: skipped_content_object_id_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX skipped_content_object_id_idx ON public.skipped_content USING btree (object_id);
--
-- Name: skipped_content_sha1_git_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX skipped_content_sha1_git_idx ON public.skipped_content USING btree (sha1_git);
--
-- Name: skipped_content_sha1_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX skipped_content_sha1_idx ON public.skipped_content USING btree (sha1);
--
-- Name: skipped_content_sha256_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE INDEX skipped_content_sha256_idx ON public.skipped_content USING btree (sha256);
--
-- Name: snapshot_branch_name_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX snapshot_branch_name_idx ON public.snapshot_branch USING btree (name) WHERE ((target_type IS NULL) AND (target IS NULL));
--
-- Name: snapshot_branch_target_type_target_name_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX snapshot_branch_target_type_target_name_idx ON public.snapshot_branch USING btree (target_type, target, name);
--
-- Name: snapshot_id_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX snapshot_id_idx ON public.snapshot USING btree (id);
--
-- Name: tool_name_version_configuration_idx; Type: INDEX; Schema: public; Owner: tony
--
CREATE UNIQUE INDEX tool_name_version_configuration_idx ON public.tool USING btree (name, version, configuration);
--
-- Name: content notify_new_content; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER notify_new_content AFTER INSERT ON public.content FOR EACH ROW EXECUTE PROCEDURE public.notify_new_content();
--
-- Name: directory notify_new_directory; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER notify_new_directory AFTER INSERT ON public.directory FOR EACH ROW EXECUTE PROCEDURE public.notify_new_directory();
--
-- Name: origin notify_new_origin; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER notify_new_origin AFTER INSERT ON public.origin FOR EACH ROW EXECUTE PROCEDURE public.notify_new_origin();
--
-- Name: origin_visit notify_new_origin_visit; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER notify_new_origin_visit AFTER INSERT ON public.origin_visit FOR EACH ROW EXECUTE PROCEDURE public.notify_new_origin_visit();
--
-- Name: release notify_new_release; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER notify_new_release AFTER INSERT ON public.release FOR EACH ROW EXECUTE PROCEDURE public.notify_new_release();
--
-- Name: revision notify_new_revision; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER notify_new_revision AFTER INSERT ON public.revision FOR EACH ROW EXECUTE PROCEDURE public.notify_new_revision();
--
-- Name: skipped_content notify_new_skipped_content; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER notify_new_skipped_content AFTER INSERT ON public.skipped_content FOR EACH ROW EXECUTE PROCEDURE public.notify_new_skipped_content();
--
-- Name: object_counts_bucketed update_counts_from_bucketed; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER update_counts_from_bucketed AFTER INSERT OR UPDATE ON public.object_counts_bucketed FOR EACH ROW WHEN (((new.line % 256) = 0)) EXECUTE PROCEDURE public.swh_update_counters_from_buckets();
--
-- Name: entity_history update_entity; Type: TRIGGER; Schema: public; Owner: tony
--
CREATE TRIGGER update_entity AFTER INSERT OR UPDATE ON public.entity_history FOR EACH ROW EXECUTE PROCEDURE public.swh_update_entity_from_entity_history();
--
-- Name: entity_equivalence entity_equivalence_entity1_fkey; Type: FK CONSTRAINT; Schema: public; Owner: tony