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
47 changes: 32 additions & 15 deletions containers/event-db-migrations/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,37 @@ package:
WORKDIR /eventdb

# Add psql
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
gnupg2 \
ca-certificates \
lsb-release \
apt-transport-https \
&& rm -rf /var/lib/apt/lists/* && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
apt-get update && \
apt-get install -y --no-install-recommends postgresql-14 && \
apt-get remove -y wget gnupg2 lsb-release apt-transport-https && \
apt-get autoremove -y && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
# Install dependencies needed for adding the key and postgres
apt-get install -y --no-install-recommends \
wget \
gnupg2 \
ca-certificates \
lsb-release \
apt-transport-https && \
\
# Create the keyring directory
install -m 0755 -d /etc/apt/keyrings && \
\
# Download, de-armor, and save the PostgreSQL key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
gpg --dearmor -o /etc/apt/keyrings/postgresql.gpg && \
\
# Set permissions for the key
chmod 644 /etc/apt/keyrings/postgresql.gpg && \
\
# Create the sources list, pointing to the key
echo "deb [signed-by=/etc/apt/keyrings/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
\
# Update apt and install postgresql
apt-get update && \
apt-get install -y --no-install-recommends postgresql-14 && \
\
# Clean up
apt-get remove -y wget gnupg2 lsb-release apt-transport-https && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Add refinery
COPY +build/refinery .
Expand All @@ -55,7 +72,7 @@ package:

ENTRYPOINT ["./entry.sh"]
SAVE IMAGE migrations:$tag

# TODO: Enable this when CI supports passing -P dynamically
# test:
# FROM earthly/dind:alpine
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- F14
-- F15
INSERT INTO event (
row_id,
name,
Expand Down Expand Up @@ -26,25 +26,25 @@ INSERT INTO event (
extra,
cast_to
) VALUES (
14,
'Fund 14',
'Catalyst Testnet - Fund 14',
'2025-09-06 21:45:00', -- Registration Snapshot Time
'2025-09-06 22:00:00', -- Snapshot Start.
15,
'Fund 15',
'Catalyst Testnet - Fund 15',
'2025-11-10 10:00:00', -- Registration Snapshot Time
'2025-11-10 10:15:00', -- Snapshot Start.
25000000, -- Voting Power Threshold
100, -- Max Voting Power PCT
NULL, -- Review Rewards
'2025-07-22 10:00:00', -- Start Time
'2025-10-27 07:00:00', -- End Time
'2025-07-22 10:00:00', -- Insight Sharing Start
'2025-07-22 10:00:00', -- Proposal Submission Start
'2025-07-22 10:00:00', -- Refine Proposals Start
'2025-07-22 10:00:00', -- Finalize Proposals Start
'2025-07-22 10:00:00', -- Proposal Assessment Start
'2025-07-22 10:00:00', -- Assessment QA Start
'2025-09-22 12:00:00', -- Voting Starts
'2025-10-06 11:00:00', -- Voting Ends
'2025-10-27 07:00:00', -- Tallying Ends
'2025-11-10 10:00:00', -- Start Time
'2026-02-15 07:00:00', -- End Time
'2025-11-10 10:00:00', -- Insight Sharing Start
'2025-11-10 10:00:00', -- Proposal Submission Start
'2025-11-10 10:00:00', -- Refine Proposals Start
'2025-11-10 10:00:00', -- Finalize Proposals Start
'2025-11-10 10:00:00', -- Proposal Assessment Start
'2025-11-10 10:00:00', -- Assessment QA Start
'2025-11-10 10:00:00', -- Voting Starts
'2026-01-25 11:00:00', -- Voting Ends
'2026-02-15 07:00:00', -- Tallying Ends
NULL, -- Block 0 Data
NULL, -- Block 0 Hash
1, -- Committee Size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Define F14 IdeaScale parameters.
-- Define F15 IdeaScale parameters.
INSERT INTO config (id, id2, id3, value) VALUES (
'ideascale',
'14',
'15',
'',
'{
"group_id": 31051,
Expand Down Expand Up @@ -51,11 +51,11 @@ INSERT INTO config (id, id2, id3, value) VALUES (
) ON CONFLICT (id, id2, id3) DO UPDATE
SET value = EXCLUDED.value;

-- Use F14 params for event with row_id = 14.
-- Use F15 params for event with row_id = 15.
INSERT INTO config (id, id2, id3, value) VALUES (
'event',
'ideascale_params',
'14',
'{"params_id": "F14"}'
'15',
'{"params_id": "F15"}'
) ON CONFLICT (id, id2, id3) DO UPDATE
SET value = EXCLUDED.value;
Loading