Skip to content

Commit

Permalink
fix(norm): ensure all schema qualifier removed from diff if expected …
Browse files Browse the repository at this point in the history
…schema
  • Loading branch information
uladkasach committed Jun 30, 2020
1 parent 2379a61 commit 8874bba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ CREATE TABLE superimportantdb.some_resource_table (
id bigserial NOT NULL,
created_at timestamp with time zone NULL DEFAULT now(),
CONSTRAINT some_resource_table_pk PRIMARY KEY (id)
)"
);
CREATE INDEX some_resource_table_ix ON superimportantdb.job_cvp USING btree (job_version_id);
"
`.trim();
const normalizedDdl = normalizeCreateDdlPostgres({
schema: 'superimportantdb',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export const normalizeCreateDdlPostgres = ({
})();

// strip the ` ${schema}.` qualifier, if the resource is for the same schema that we expect
return normalizedDdl.replace(` ${schema}.`, ' '); // its implied that it will be for this schema, so no need to include it
return normalizedDdl.replace(new RegExp(` ${schema}.`, 'g'), ' '); // its implied that it will be for this schema, so no need to include it
};

0 comments on commit 8874bba

Please sign in to comment.