squawk icon indicating copy to clipboard operation
squawk copied to clipboard

Only warn once about error in GitHub per statement

Open chdsbd opened this issue 9 months ago • 0 comments

BEGIN;
--
-- Create model RecipeCookChecklistCheck
--
CREATE TABLE "recipe_cook_checklist_check" ("created" timestamp with time zone NOT NULL, "modified" timestamp with time zone NOT NULL, "id" serial NOT NULL PRIMARY KEY, "checked" boolean NOT NULL, "ingredient_id" integer NOT NULL, "recipe_id" integer NOT NULL);
--
-- Create constraint recipe_ingredient_uniq on model recipecookchecklistcheck
--
ALTER TABLE "recipe_cook_checklist_check" ADD CONSTRAINT "recipe_ingredient_uniq" UNIQUE ("recipe_id", "ingredient_id");
ALTER TABLE "recipe_cook_checklist_check" ADD CONSTRAINT "recipe_cook_checklis_ingredient_id_34366863_fk_core_ingr" FOREIGN KEY ("ingredient_id") REFERENCES "core_ingredient" ("id") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE "recipe_cook_checklist_check" ADD CONSTRAINT "recipe_cook_checklis_recipe_id_9fcfea61_fk_core_reci" FOREIGN KEY ("recipe_id") REFERENCES "core_recipe" ("id") DEFERRABLE INITIALLY DEFERRED;
CREATE INDEX "recipe_cook_checklist_check_ingredient_id_34366863" ON "recipe_cook_checklist_check" ("ingredient_id");
CREATE INDEX "recipe_cook_checklist_check_recipe_id_9fcfea61" ON "recipe_cook_checklist_check" ("recipe_id");
COMMIT;
example.sql:2:1: warning: prefer-big-int

   2 | --
   3 | -- Create model RecipeCookChecklistCheck
   4 | --
   5 | CREATE TABLE "recipe_cook_checklist_check" ("created" timestamp with time zone NOT NULL, "modified" timestamp with time zone NOT NULL, "id" serial NOT NULL PRIMARY KEY, "checked" boolean NOT NULL, "ingredient_id" integer NOT NULL, "recipe_id" integer NOT NULL);

  note: Hitting the max 32 bit integer is possible and may break your application.
  help: Use 64bit integer values instead to prevent hitting this limit.

example.sql:2:1: warning: prefer-big-int

   2 | --
   3 | -- Create model RecipeCookChecklistCheck
   4 | --
   5 | CREATE TABLE "recipe_cook_checklist_check" ("created" timestamp with time zone NOT NULL, "modified" timestamp with time zone NOT NULL, "id" serial NOT NULL PRIMARY KEY, "checked" boolean NOT NULL, "ingredient_id" integer NOT NULL, "recipe_id" integer NOT NULL);

  note: Hitting the max 32 bit integer is possible and may break your application.
  help: Use 64bit integer values instead to prevent hitting this limit.

example.sql:2:1: warning: prefer-big-int

   2 | --
   3 | -- Create model RecipeCookChecklistCheck
   4 | --
   5 | CREATE TABLE "recipe_cook_checklist_check" ("created" timestamp with time zone NOT NULL, "modified" timestamp with time zone NOT NULL, "id" serial NOT NULL PRIMARY KEY, "checked" boolean NOT NULL, "ingredient_id" integer NOT NULL, "recipe_id" integer NOT NULL);

  note: Hitting the max 32 bit integer is possible and may break your application.
  help: Use 64bit integer values instead to prevent hitting this limit.

example.sql:2:1: warning: prefer-bigint-over-int

   2 | --
   3 | -- Create model RecipeCookChecklistCheck
   4 | --
   5 | CREATE TABLE "recipe_cook_checklist_check" ("created" timestamp with time zone NOT NULL, "modified" timestamp with time zone NOT NULL, "id" serial NOT NULL PRIMARY KEY, "checked" boolean NOT NULL, "ingredient_id" integer NOT NULL, "recipe_id" integer NOT NULL);

  note: Hitting the max 32 bit integer is possible and may break your application.
  help: Use 64bit integer values instead to prevent hitting this limit.

example.sql:2:1: warning: prefer-bigint-over-int

   2 | --
   3 | -- Create model RecipeCookChecklistCheck
   4 | --
   5 | CREATE TABLE "recipe_cook_checklist_check" ("created" timestamp with time zone NOT NULL, "modified" timestamp with time zone NOT NULL, "id" serial NOT NULL PRIMARY KEY, "checked" boolean NOT NULL, "ingredient_id" integer NOT NULL, "recipe_id" integer NOT NULL);

  note: Hitting the max 32 bit integer is possible and may break your application.
  help: Use 64bit integer values instead to prevent hitting this limit.

example.sql:2:1: warning: prefer-bigint-over-int

   2 | --
   3 | -- Create model RecipeCookChecklistCheck
   4 | --
   5 | CREATE TABLE "recipe_cook_checklist_check" ("created" timestamp with time zone NOT NULL, "modified" timestamp with time zone NOT NULL, "id" serial NOT NULL PRIMARY KEY, "checked" boolean NOT NULL, "ingredient_id" integer NOT NULL, "recipe_id" integer NOT NULL);

  note: Hitting the max 32 bit integer is possible and may break your application.
  help: Use 64bit integer values instead to prevent hitting this limit.

example.sql:2:1: warning: prefer-identity

   2 | --
   3 | -- Create model RecipeCookChecklistCheck
   4 | --
   5 | CREATE TABLE "recipe_cook_checklist_check" ("created" timestamp with time zone NOT NULL, "modified" timestamp with time zone NOT NULL, "id" serial NOT NULL PRIMARY KEY, "checked" boolean NOT NULL, "ingredient_id" integer NOT NULL, "recipe_id" integer NOT NULL);

  note: Serial types have confusing behaviors that make schema management difficult.
  help: Use identity columns instead for more features and better usability.

example.sql:10:1: warning: adding-foreign-key-constraint

  10 | ALTER TABLE "recipe_cook_checklist_check" ADD CONSTRAINT "recipe_cook_checklis_ingredient_id_34366863_fk_core_ingr" FOREIGN KEY ("ingredient_id") REFERENCES "core_ingredient" ("id") DEFERRABLE INITIALLY DEFERRED;

  note: Requires a table scan of the table you're altering and a SHARE ROW EXCLUSIVE lock on both tables, which blocks writes to both tables while your table is scanned.
  help: Add NOT VALID to the constraint in one transaction and then VALIDATE the constraint in a separate transaction.

example.sql:11:1: warning: adding-foreign-key-constraint

  11 | ALTER TABLE "recipe_cook_checklist_check" ADD CONSTRAINT "recipe_cook_checklis_recipe_id_9fcfea61_fk_core_reci" FOREIGN KEY ("recipe_id") REFERENCES "core_recipe" ("id") DEFERRABLE INITIALLY DEFERRED;

  note: Requires a table scan of the table you're altering and a SHARE ROW EXCLUSIVE lock on both tables, which blocks writes to both tables while your table is scanned.
  help: Add NOT VALID to the constraint in one transaction and then VALIDATE the constraint in a separate transaction.

find detailed examples and solutions for each rule at https://squawkhq.com/docs/rules

chdsbd avatar Sep 23 '23 02:09 chdsbd