Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

ci: refactor --db-url commands for self-hosted deployments

Brad Barbin29bf354941fa
diff --git a/ci/src/migrations.ts b/ci/src/migrations.ts
index b9d156b58e..8219800f3f 100644
--- a/ci/src/migrations.ts
+++ b/ci/src/migrations.ts
@@ -75,17 +75,23 @@ async function migrate(): Promise<void> {
cwd: "supabase",
});
- let dbArg = "";
if (project_id) {
await $$`supabase link`;
- } else if (database_url.startsWith("postgresql://")) {
- dbArg = `--db-url ${database_url}`;
}
console.log(`✅ 🐣 Starting migrations for ${customer.id}`);
- await $$`supabase db push ${dbArg} --include-all`;
+ if (database_url && database_url.startsWith("postgresql://")) {
+ await $$`supabase db push --db-url ${database_url} --include-all`;
+ } else {
+ await $$`supabase db push --include-all`;
+ }
+
console.log(`✅ 🐣 Starting deployments for ${customer.id}`);
- await $$`supabase functions deploy ${dbArg}`;
+ if (database_url && database_url.startsWith("postgresql://")) {
+ await $$`supabase functions deploy --db-url ${database_url}`;
+ } else {
+ await $$`supabase functions deploy`;
+ }
if (!customer.seeded) {
try {