Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only warn once about error in GitHub per statement #319

Open
chdsbd opened this issue Sep 23, 2023 · 0 comments
Open

Only warn once about error in GitHub per statement #319

chdsbd opened this issue Sep 23, 2023 · 0 comments

Comments

@chdsbd
Copy link
Collaborator

chdsbd commented Sep 23, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant