fix(data): include routing order in postgres snapshot

This commit is contained in:
elky
2026-09-03 12:51:37 +08:00
parent 668bf5e40f
commit 058660ec2e
3 changed files with 6 additions and 1 deletions
@@ -4,6 +4,7 @@ CREATE TABLE IF NOT EXISTS public.routing_groups (
description text,
enabled boolean DEFAULT true NOT NULL,
is_system_default boolean DEFAULT false NOT NULL,
sort_order bigint DEFAULT 0 NOT NULL,
config_json jsonb NOT NULL,
version bigint DEFAULT 1 NOT NULL,
created_at bigint NOT NULL,
@@ -31,6 +32,8 @@ CREATE INDEX IF NOT EXISTS routing_groups_system_default_idx
CREATE UNIQUE INDEX IF NOT EXISTS routing_groups_one_system_default_key
ON public.routing_groups (is_system_default)
WHERE is_system_default = TRUE;
CREATE INDEX IF NOT EXISTS routing_groups_enabled_sort_idx
ON public.routing_groups (enabled DESC, sort_order, name, id);
CREATE TABLE IF NOT EXISTS public.routing_group_bindings (
id character varying(64) NOT NULL,
@@ -7,7 +7,7 @@ use tracing::info;
// Generated by build.rs from schema/bootstrap/postgres.
pub(crate) static EMPTY_DATABASE_SNAPSHOT_SQL: &str =
include_str!(concat!(env!("OUT_DIR"), "/empty_database_snapshot.sql"));
pub(crate) const EMPTY_DATABASE_SNAPSHOT_CUTOFF_VERSION: i64 = 20260821000000;
pub(crate) const EMPTY_DATABASE_SNAPSHOT_CUTOFF_VERSION: i64 = 20260903000000;
const PUBLIC_BASE_TABLE_COUNT_SQL: &str = r#"
SELECT COUNT(*)::BIGINT
@@ -412,6 +412,7 @@ fn empty_database_snapshot_covers_current_cutoff_versions() {
20260727000000,
20260731000000,
20260821000000,
20260903000000,
]
);
}
@@ -2210,6 +2211,7 @@ fn pending_migrations_from_applied_skips_versions_already_applied() {
20260727000000,
20260731000000,
20260821000000,
20260903000000,
]
);
}