spfn 0.2.0-beta.40 → 0.2.0-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -755,7 +755,7 @@ var init_deployment_config = __esm({
755
755
 
756
756
  // src/utils/version.ts
757
757
  function getCliVersion() {
758
- return "0.2.0-beta.40";
758
+ return "0.2.0-beta.41";
759
759
  }
760
760
  function getTagFromVersion(version) {
761
761
  const match = version.match(/-([a-z]+)\./i);
@@ -2451,7 +2451,7 @@ async function dbPush(options = {}) {
2451
2451
  schemaFilter
2452
2452
  );
2453
2453
  const managedSchemaSet = new Set(schemaFilter);
2454
- const statements = statementsToExecute.filter((s) => {
2454
+ const patched = statementsToExecute.filter((s) => {
2455
2455
  const dropMatch = s.match(/^\s*DROP\s+SCHEMA\s+"?([^"\s;]+)"?/i);
2456
2456
  if (dropMatch && managedSchemaSet.has(dropMatch[1])) {
2457
2457
  console.log(chalk13.dim(` [skip] DROP SCHEMA "${dropMatch[1]}" \u2014 managed schema, ignoring`));
@@ -2461,7 +2461,10 @@ async function dbPush(options = {}) {
2461
2461
  }).map(
2462
2462
  (s) => s.replace(/^CREATE SCHEMA(?!\s+IF\s+NOT\s+EXISTS)/i, "CREATE SCHEMA IF NOT EXISTS")
2463
2463
  );
2464
- if (statements.length === 0) {
2464
+ const ensureSchemas = schemaFilter.filter((s) => s !== "public").map((s) => `CREATE SCHEMA IF NOT EXISTS "${s}";
2465
+ `);
2466
+ const statements = [...ensureSchemas, ...patched];
2467
+ if (patched.length === 0) {
2465
2468
  console.log(chalk13.green("\u2705 No changes detected \u2014 database is up to date\n"));
2466
2469
  await applyFunctionMigrations();
2467
2470
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spfn",
3
- "version": "0.2.0-beta.40",
3
+ "version": "0.2.0-beta.41",
4
4
  "description": "Superfunction CLI - Add SPFN to your Next.js project",
5
5
  "type": "module",
6
6
  "bin": {