cli icon indicating copy to clipboard operation
cli copied to clipboard

`migration squash` eliminates SQL statements

Open zeekrey opened this issue 2 years ago • 2 comments

Describe the bug I encountered a bug while attempting to squash migrations using `supabase migration squash. It appears that this operation inadvertently removed SQL statements that targeted the storage schema.

To Reproduce Steps to reproduce the behavior:

  1. Create two migrations and include the following example statement:
-- Create buckets
INSERT INTO STORAGE.buckets (id, name)
VALUES (
    'documents',
    'documents'
  );
  1. Run supabase migration squash
  2. Check if the above statement is present in the resulting migration file.

Expected behavior I expected that executing supabase migration squash would not alter the outcome of the migration.

Desktop (please complete the following information):

  • OS: macOS
  • Version of CLI: 1.100.1
  • Version of Node.js: 18.13.0

zeekrey avatar Oct 26 '23 13:10 zeekrey

It also does not include cron jobs. Perhaps it would be nice to document somewhere in the CLI docs that some statements will be missing. It took us quite some time to figure this out.

sagacity-felix avatar Jun 11 '24 13:06 sagacity-felix

Perhaps it would be nice to document somewhere in the CLI docs that some statements will be missing.

Good call. I will update the docs accordingly https://github.com/supabase/cli/pull/2412

sweatybridge avatar Jun 11 '24 14:06 sweatybridge