Files
cloud-host/backend/migrations/005_pricing_catalog_all_runtimes.sql
keyhan bb27c90ae4 Make billing catalog dynamic for all runtimes and bill optional service resources.
Derive admin tabs and addon rows from enums, and add Redis/RabbitMQ/ES CPU/RAM/disk to deploy cost using the app runtime unit rates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 18:22:35 +03:30

25 lines
564 B
SQL

-- Ensure pricing_rates rows exist for every AppRuntime enum value
INSERT INTO pricing_rates (runtime, resource_type, hourly_price, monthly_price, yearly_price)
SELECT r.runtime, t.resource_type, 0, 0, 0
FROM (
VALUES
('nodejs'),
('laravel'),
('wordpress'),
('go'),
('php'),
('python'),
('django'),
('dotnet')
) AS r(runtime)
CROSS JOIN (
VALUES
('base_fee'),
('cpu_per_core'),
('memory_per_gb'),
('storage_per_gb'),
('database_addon')
) AS t(resource_type)
ON CONFLICT (runtime, resource_type) DO NOTHING;