Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/schema-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Validate schema is in sync with migrations
run: |
# Apply migrations
dbmate up
DBMATE_SCHEMA_FILE=ci-dump.sql dbmate up

# Force dump in case problems were ignored
DBMATE_SCHEMA_FILE=ci-dump.sql dbmate dump
Expand Down
28 changes: 15 additions & 13 deletions database.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\restrict ofpmBZgaMbuYf558teg7MYcyPbiwJkZyYgREoiBTduRUlCZa72Go911eC5LHqgI
\restrict AsCPTOt3U9KhJ9fUdZGWUtrBsH1prEN0qQZE48Juv4M8WNoa7mPKZojrPqmzFhv

-- Dumped from database version 16.11 (Ubuntu 16.11-1.pgdg24.04+1)
-- Dumped by pg_dump version 16.11 (Ubuntu 16.11-1.pgdg24.04+1)
Expand Down Expand Up @@ -602,40 +602,41 @@ $$;


--
-- Name: validate_transformation_key_offset(jsonb); Type: FUNCTION; Schema: public; Owner: -
-- Name: validate_transformation_key_length(jsonb); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.validate_transformation_key_offset(object jsonb) RETURNS boolean
CREATE FUNCTION public.validate_transformation_key_length(object jsonb) RETURNS boolean
LANGUAGE plpgsql
AS $$
BEGIN
RETURN object ? 'offset' AND is_jsonb_number(object -> 'offset') AND (object ->> 'offset')::integer >= 0;
RETURN object ? 'length' AND is_jsonb_number(object -> 'length') AND (object ->> 'length')::integer > 0;
END;
$$;


--
-- Name: validate_transformation_key_length(jsonb); Type: FUNCTION; Schema: public; Owner: -
-- Name: validate_transformation_key_length_optional(jsonb); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.validate_transformation_key_length(object jsonb) RETURNS boolean
CREATE FUNCTION public.validate_transformation_key_length_optional(object jsonb) RETURNS boolean
LANGUAGE plpgsql
AS $$
BEGIN
RETURN object ? 'length' AND is_jsonb_number(object -> 'length') AND (object ->> 'length')::integer > 0;
RETURN NOT object ? 'length'
OR (is_jsonb_number(object -> 'length') AND (object ->> 'length')::integer > 0);
END;
$$;


--
-- Name: validate_transformation_key_length_optional(jsonb); Type: FUNCTION; Schema: public; Owner: -
-- Name: validate_transformation_key_offset(jsonb); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.validate_transformation_key_length_optional(object jsonb) RETURNS boolean
CREATE FUNCTION public.validate_transformation_key_offset(object jsonb) RETURNS boolean
LANGUAGE plpgsql
AS $$
BEGIN
RETURN NOT object ? 'length'
OR (is_jsonb_number(object -> 'length') AND (object ->> 'length')::integer > 0);
RETURN object ? 'offset' AND is_jsonb_number(object -> 'offset') AND (object ->> 'offset')::integer >= 0;
END;
$$;

Expand Down Expand Up @@ -1730,7 +1731,7 @@ ALTER TABLE ONLY public.verified_contracts
-- PostgreSQL database dump complete
--

\unrestrict ofpmBZgaMbuYf558teg7MYcyPbiwJkZyYgREoiBTduRUlCZa72Go911eC5LHqgI
\unrestrict AsCPTOt3U9KhJ9fUdZGWUtrBsH1prEN0qQZE48Juv4M8WNoa7mPKZojrPqmzFhv


--
Expand All @@ -1741,4 +1742,5 @@ INSERT INTO public.schema_migrations (version) VALUES
('20250717103432'),
('20250723145429'),
('20251023134207'),
('20251106144315');
('20251106144315'),
('20260126113330');