-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
90 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- date: 2024-11-13 | ||
-- description: 初始化 | ||
|
||
CREATE ROLE jtools LOGIN PASSWORD 'jtools'; | ||
|
||
CREATE DATABASE jtools WITH OWNER = jtools; | ||
|
||
GRANT CONNECT ON DATABASE jtools TO jtools; | ||
GRANT CONNECT ON DATABASE jianshu TO jtools; | ||
GRANT CONNECT ON DATABASE jpep TO jtools; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- date: 2024-11-13 | ||
-- description: 初始化 | ||
|
||
GRANT SELECT ON TABLE article_earning_ranking_records TO jtools; | ||
GRANT SELECT ON TABLE lottery_win_records TO jtools; | ||
GRANT SELECT ON TABLE users TO jtools; | ||
|
||
CREATE EXTENSION pg_trgm; | ||
|
||
CREATE INDEX CONCURRENTLY idx_article_earning_ranking_records_ranking ON article_earning_ranking_records (ranking); | ||
CREATE INDEX CONCURRENTLY idx_lottery_win_records_time ON lottery_win_records (time); | ||
CREATE INDEX CONCURRENTLY idx_lottery_win_records_user_slug ON lottery_win_records (user_slug); | ||
CREATE INDEX CONCURRENTLY idx_lottery_win_records_award_name ON lottery_win_records (award_name); | ||
CREATE INDEX CONCURRENTLY idx_users_name ON users USING gin (name gin_trgm_ops); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- date: 2024-11-13 | ||
-- description: 初始化 | ||
|
||
GRANT SELECT ON TABLE ftn_macket_records TO jtools; | ||
GRANT SELECT ON TABLE ftn_orders TO jtools; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- date: 2024-11-13 | ||
-- description: 初始化 | ||
|
||
GRANT SELECT ON TABLE debug_project_records TO jtools; | ||
GRANT SELECT ON TABLE tech_stacks TO jtools; | ||
GRANT SELECT, INSERT ON TABLE tools TO jtools; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- date: 2024-11-13 | ||
-- description: 初始化 | ||
|
||
CREATE TABLE debug_project_records ( | ||
id SMALLSERIAL CONSTRAINT pk_debug_project_records_id PRIMARY KEY, | ||
date DATE NOT NULL, | ||
type TEXT NOT NULL, | ||
module TEXT NOT NULL, | ||
description TEXT NOT NULL, | ||
user_name TEXT NOT NULL, | ||
user_slug VARCHAR(12) NOT NULL, | ||
reward SMALLINT NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- date: 2024-11-13 | ||
-- description: 初始化 | ||
|
||
CREATE TYPE enum_tech_stacks_type AS ENUM ('LIBRARY', 'EXTERNAL_SERVICE'); | ||
CREATE TYPE enum_tech_stacks_scope AS ENUM ('FRONTEND', 'BACKEND', 'TOOLCHAIN'); | ||
|
||
CREATE TABLE tech_stacks ( | ||
name TEXT NOT NULL CONSTRAINT pk_tech_stacks_name PRIMARY KEY, | ||
type enum_tech_stacks_type NOT NULL, | ||
scope enum_tech_stacks_scope NOT NULL, | ||
is_self_developed BOOLEAN NOT NULL, | ||
description TEXT NOT NULL, | ||
url TEXT NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- date: 2024-11-13 | ||
-- description: 初始化 | ||
|
||
CREATE TYPE enum_tools_status AS ENUM ('NORMAL', 'DOWNGRADED', 'UNAVAILABLE'); | ||
|
||
CREATE TABLE tools ( | ||
slug TEXT CONSTRAINT pk_tools_slug PRIMARY KEY, | ||
status enum_tools_status NOT NULL, | ||
status_description TEXT, | ||
data_update_freq TEXT NOT NULL, | ||
last_update_time_table TEXT, | ||
last_update_time_order_by TEXT, | ||
last_update_time_target_field TEXT, | ||
data_count_table TEXT, | ||
data_source JSONB | ||
); |