github.com/supabase/cli@v1.168.1/internal/utils/parser/testdata/split_04.sql (about)

     1  
     2  
     3  CREATE TABLE "blocks"."placement"
     4  (
     5      location_name   CHARACTER VARYING   NOT NULL,
     6      index           INT                 NOT NULL,
     7      block_uuid      UUID                NOT NULL,
     8      scope_path      CHARACTER VARYING   NOT NULL,
     9      inherited       BOOL DEFAULT FALSE  NOT NULL,
    10      excluded_scopes CHARACTER VARYING [],
    11  
    12      -- NOTE: Because we UPDATE the primary (location_name, index) key on the placement-table,
    13      -- the constraint behavior on the primary key is set to DEFERRABLE and INITIALLY IMMEDIATE.
    14      --
    15      -- For more inforation, refer to this bug-report:
    16      --
    17      -- https://www.postgresql.org/message-id/flat/20170322123053.1421.55154%40wrigleys.postgresql.org
    18  
    19      CONSTRAINT placement_location_name_index_pk PRIMARY KEY (location_name, index) DEFERRABLE INITIALLY IMMEDIATE,
    20      CONSTRAINT placement_block_uuid_fk FOREIGN KEY (block_uuid) REFERENCES "blocks"."block" (uuid) ON DELETE CASCADE
    21  );