Skip to content

Commit

Permalink
leaderboard table
Browse files Browse the repository at this point in the history
  • Loading branch information
0xthrpw committed Jul 31, 2024
1 parent 70ba576 commit d49d245
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions db/schema/020__tables/001/create_table__efp_leaderboard.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- migrate:up
-------------------------------------------------------------------------------
-- Table: efp_leaderboard
-------------------------------------------------------------------------------
CREATE TABLE
public.efp_leaderboard (
"name" TEXT NOT NULL,
"address" types.eth_address NOT NULL,
"avatar" TEXT,
"mutuals" BIGINT,
"following" BIGINT,
"followers" BIGINT,
"blocks" BIGINT,
created_at TIMESTAMP
WITH
TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP
WITH
TIME ZONE DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY ("address", "name")
);

CREATE TRIGGER
update_efp_leaderboard_updated_at BEFORE
UPDATE
ON public.efp_leaderboard FOR EACH ROW
EXECUTE
FUNCTION public.update_updated_at_column();

-- migrate:down
-------------------------------------------------------------------------------
-- Undo Table: efp_leaderboard
-------------------------------------------------------------------------------
DROP TABLE
IF EXISTS public.efp_leaderboard CASCADE;

0 comments on commit d49d245

Please sign in to comment.