You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are the SQL statements that this spits out in sqlmigrate:
BEGIN;
---- Create model ShipmentMetadataAlert--CREATETABLE "shipments_shipmentmetadataalert" ("deleted_at"timestamp with time zoneNULL, "created_at"timestamp with time zoneNOT NULL, "updated_at"timestamp with time zoneNOT NULL, "id" uuid NOT NULLPRIMARY KEY, "message"textNULL, "level"varchar(16) NULL, "type"varchar(32) NULL, "subtype"varchar(32) NULL, "occurred_at"timestamp with time zoneNULL, "clear_alert_job_id" uuid NULL, "metadata_id" uuid NOT NULL);
ALTERTABLE"shipments_shipmentmetadataalert" ADD CONSTRAINT"shipments_shipmentme_metadata_id_f20850e8_fk_shipments"FOREIGN KEY ("metadata_id") REFERENCES"shipments_shipmentmetadata" ("id") DEFERRABLE INITIALLY DEFERRED;
CREATEINDEX "shipments_shipmentmetadataalert_deleted_at_c9a93342" ON"shipments_shipmentmetadataalert" ("deleted_at");
CREATEINDEX "shipments_shipmentmetadataalert_metadata_id_f20850e8" ON"shipments_shipmentmetadataalert" ("metadata_id");
COMMIT;
This is an error from the linter as it outputs the error CREATE INDEX locks table. But the table is being created within the migration, it just needs to recognize that.
It seems like the CREATE INDEX detection should work the same way that the ADD_UNIQUE detection works where it detects that the create table is happening in the same migration:
Here is an example
CreateModel
from Django:Here are the SQL statements that this spits out in
sqlmigrate
:This is an error from the linter as it outputs the error
CREATE INDEX locks table
. But the table is being created within the migration, it just needs to recognize that.It seems like the
CREATE INDEX
detection should work the same way that theADD_UNIQUE
detection works where it detects that the create table is happening in the same migration:django-migration-linter/django_migration_linter/sql_analyser/base.py
Lines 26 to 40 in db71a9d
The text was updated successfully, but these errors were encountered: