Skip to content

An open-source, faster Devin alternative

TypeScript

migrations: start the trial for free orgs at launch (086 step 8)

Mohamed Habib via Computere25331ebfd6e
diff --git a/cloudflare-workers/api-edge/migrations/0019_orgs_backfill_trial_start.sql b/cloudflare-workers/api-edge/migrations/0019_orgs_backfill_trial_start.sql
new file mode 100644
index 00000000..63fca90b
--- /dev/null
+++ b/cloudflare-workers/api-edge/migrations/0019_orgs_backfill_trial_start.sql
@@ -0,0 +1,7 @@
+-- orgs.trial_started_at (serverless-agents-ws 086, step 8): every free org gets
+-- the 7-day trial from launch day, as new signups do. Autumn attaches `trial`
+-- to each base customer after this runs; the edge keeps them on the credit rule
+-- until it is attached, so the stamp alone changes nothing. Paid orgs (pro,
+-- max) and legacy billing are left alone.
+UPDATE orgs SET trial_started_at = unixepoch()
+ WHERE billing_provider = 'autumn' AND usage_plan = 'base';