flagon-io/g1t

public

Git for AI scale: a forge for thousands of agents working on the same code at once.

g1t/services/billing/migrations/0015_sandbox_at_cost.sql

17 lines887 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Prices are what g1t pays plus 20%, from the first second1-- Sandbox time is charged at cost plus 20% from the first second, like
2-- everything else in the price book. There are no free minutes, so the
3-- monthly count that measured them goes.
4
5-- A change can be to the markup rather than to the cost: what it was.
6ALTER TABLE price_changes ADD COLUMN old_markup_percent INTEGER;
7
8INSERT INTO price_changes (id, meter, old_cost_micros, new_cost_micros, markup_percent, old_markup_percent, reason, created_at)
9SELECT 'prc_sandbox_at_cost', meter, cost_micros, cost_micros, 20, markup_percent,
10 'Sandbox time is now charged at cost plus 20% from the first second',
11 strftime('%Y-%m-%dT%H:%M:%SZ', 'now')
12FROM prices WHERE meter = 'sandbox_second' AND markup_percent <> 20;
13
14UPDATE prices SET markup_percent = 20, updated_at = strftime('%Y-%m-%dT%H:%M:%SZ', 'now')
15WHERE meter = 'sandbox_second';
16
17DROP TABLE IF EXISTS sandbox_months;