-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
29 lines (24 loc) · 1.19 KB
/
schema.sql
File metadata and controls
29 lines (24 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- ============================================================
-- CloudPing PostgreSQL Schema
-- 执行方式: psql -d cloudping -f schema.sql
-- ============================================================
-- 扩展(每个库只需一次)
CREATE EXTENSION IF NOT EXISTS intarray; -- 整数数组高级操作 @*
CREATE EXTENSION IF NOT EXISTS btree_gist; -- GiST 支持复合索引(可选)
-- 设置
SET timezone = 'UTC';
-- ------------------------------------------------------------
-- 1. Generations(MRT 解析批次)
-- ------------------------------------------------------------
CREATE TYPE generation_status AS ENUM ('provisioning', 'ready');
CREATE TABLE IF NOT EXISTS generations (
id serial PRIMARY KEY,
source text NOT NULL,
status generation_status NOT NULL DEFAULT 'provisioning',
created_at timestamptz NOT NULL DEFAULT now()
);
-- ------------------------------------------------------------
-- 2. MRT 原始路由条目(从 MRTDump 解析)
-- Schema is managed dynamically by MRTEntriesTableBuilder.
-- See mrt_entries_table_builder.go for the authoritative definition.
-- ------------------------------------------------------------