mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
f47f89d997
Removes the legacy tailnet v1 API tables (`tailnet_clients`, `tailnet_agents`, `tailnet_client_subscriptions`) and their associated queries, triggers, and functions. These were superseded by the v2 tables (`tailnet_peers`, `tailnet_tunnels`) in migration 000168, and the v1 API code was removed in commit d6154c4310, but the database artifacts were never cleaned up.
**Changes:**
- New migration `000410_remove_tailnet_v1_tables` to drop the unused tables
- Removed 11 unused queries from `tailnet.sql`
- Removed associated manual wrapper methods in `dbauthz` and `dbmetrics`
- ~930 lines deleted across 11 files
21 lines
1.0 KiB
SQL
21 lines
1.0 KiB
SQL
-- Remove unused tailnet v1 API tables.
|
|
-- These tables were superseded by tailnet_peers and tailnet_tunnels in migration
|
|
-- 000168. The v1 API code was removed in commit d6154c4310 ("remove tailnet v1
|
|
-- API support"), but the tables and queries were never cleaned up.
|
|
|
|
-- Drop triggers first (they reference the functions).
|
|
DROP TRIGGER IF EXISTS tailnet_notify_agent_change ON tailnet_agents;
|
|
DROP TRIGGER IF EXISTS tailnet_notify_client_change ON tailnet_clients;
|
|
DROP TRIGGER IF EXISTS tailnet_notify_client_subscription_change ON tailnet_client_subscriptions;
|
|
|
|
-- Drop the trigger functions.
|
|
DROP FUNCTION IF EXISTS tailnet_notify_agent_change();
|
|
DROP FUNCTION IF EXISTS tailnet_notify_client_change();
|
|
DROP FUNCTION IF EXISTS tailnet_notify_client_subscription_change();
|
|
|
|
-- Drop the tables. Foreign keys and indexes are dropped automatically via CASCADE.
|
|
-- Order matters due to potential foreign key relationships.
|
|
DROP TABLE IF EXISTS tailnet_client_subscriptions;
|
|
DROP TABLE IF EXISTS tailnet_agents;
|
|
DROP TABLE IF EXISTS tailnet_clients;
|