Skip to content
Closed
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
90 changes: 89 additions & 1 deletion sql/01_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ begin
if (cooldown_days is null or cooldown_days = 0) then
-- Check if there is an existing notification with the same fields in the last 15 minutes

if new.challenge_id not in ('tt', 'tp', 'tut') then
if new.challenge_id not in ('tt', 'tp', 'tut', 'dvl') then
insert into notification
(blocknumber, user_ids, timestamp, type, group_id, specifier, data)
values
Expand Down Expand Up @@ -7306,6 +7306,54 @@ CREATE TABLE public.revert_blocks (
);


--
-- Name: reward_codes; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.reward_codes (
code text NOT NULL,
mint text NOT NULL,
reward_address text NOT NULL,
amount bigint NOT NULL,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


--
-- Name: TABLE reward_codes; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.reward_codes IS 'Stores reward codes for distributing coins';


--
-- Name: COLUMN reward_codes.code; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.reward_codes.code IS 'Unique code for redemption';


--
-- Name: COLUMN reward_codes.mint; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.reward_codes.mint IS 'Coin mint address';


--
-- Name: COLUMN reward_codes.reward_address; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.reward_codes.reward_address IS 'Address of the reward instance onchain';


--
-- Name: COLUMN reward_codes.amount; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.reward_codes.amount IS 'Amount of coins to reward';


--
-- Name: reward_manager_txs; Type: TABLE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -8934,6 +8982,16 @@ CREATE TABLE public.user_tips (
);


--
-- Name: volume_leader_exclusions; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.volume_leader_exclusions (
address text NOT NULL,
description text
);


--
-- Name: aggregate_daily_app_name_metrics id; Type: DEFAULT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -9706,6 +9764,14 @@ ALTER TABLE ONLY public.revert_blocks
ADD CONSTRAINT revert_blocks_pkey PRIMARY KEY (blocknumber);


--
-- Name: reward_codes reward_codes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.reward_codes
ADD CONSTRAINT reward_codes_pkey PRIMARY KEY (code);


--
-- Name: reward_manager_txs reward_manager_txs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -10282,6 +10348,14 @@ ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (txhash, user_id);


--
-- Name: volume_leader_exclusions volume_leader_exclusions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.volume_leader_exclusions
ADD CONSTRAINT volume_leader_exclusions_pkey PRIMARY KEY (address);


--
-- Name: agg_user_has_tracks_idx; Type: INDEX; Schema: public; Owner: -
--
Expand Down Expand Up @@ -11017,6 +11091,20 @@ CREATE INDEX reposts_new_created_at_idx ON public.reposts USING btree (created_a
CREATE INDEX reposts_user_idx ON public.reposts USING btree (user_id, repost_type, repost_item_id, created_at, is_delete);


--
-- Name: reward_codes_mint_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX reward_codes_mint_idx ON public.reward_codes USING btree (mint);


--
-- Name: reward_codes_reward_address_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX reward_codes_reward_address_idx ON public.reward_codes USING btree (reward_address);


--
-- Name: rpc_log_applied_at_idx; Type: INDEX; Schema: public; Owner: -
--
Expand Down
Loading