-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
82 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Generated by Django 4.2.15 on 2024-10-29 12:15 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
atomic = False # Added to support concurrent index creation | ||
dependencies = [("posthog", "0522_datawarehouse_salesforce_opportunity")] | ||
|
||
operations = [ | ||
migrations.SeparateDatabaseAndState( | ||
state_operations=[ | ||
migrations.AddField( | ||
model_name="eventdefinition", | ||
name="project", | ||
field=models.ForeignKey( | ||
null=True, on_delete=django.db.models.deletion.CASCADE, to="posthog.project" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="eventproperty", | ||
name="project", | ||
field=models.ForeignKey( | ||
null=True, on_delete=django.db.models.deletion.CASCADE, to="posthog.project" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="propertydefinition", | ||
name="project", | ||
field=models.ForeignKey( | ||
null=True, on_delete=django.db.models.deletion.CASCADE, to="posthog.project" | ||
), | ||
), | ||
], | ||
database_operations=[ | ||
migrations.RunSQL( | ||
""" | ||
-- Add field project to eventdefinition | ||
ALTER TABLE "posthog_eventdefinition" ADD COLUMN "project_id" bigint NULL CONSTRAINT "posthog_eventdefinit_project_id_f93fcbb0_fk_posthog_p" REFERENCES "posthog_project"("id") DEFERRABLE INITIALLY DEFERRED; | ||
SET CONSTRAINTS "posthog_eventdefinit_project_id_f93fcbb0_fk_posthog_p" IMMEDIATE; | ||
-- Add field project to eventproperty | ||
ALTER TABLE "posthog_eventproperty" ADD COLUMN "project_id" bigint NULL CONSTRAINT "posthog_eventproperty_project_id_dd2337d2_fk_posthog_project_id" REFERENCES "posthog_project"("id") DEFERRABLE INITIALLY DEFERRED; | ||
SET CONSTRAINTS "posthog_eventproperty_project_id_dd2337d2_fk_posthog_project_id" IMMEDIATE; | ||
-- Add field project to propertydefinition | ||
ALTER TABLE "posthog_propertydefinition" ADD COLUMN "project_id" bigint NULL CONSTRAINT "posthog_propertydefi_project_id_d3eb982d_fk_posthog_p" REFERENCES "posthog_project"("id") DEFERRABLE INITIALLY DEFERRED; | ||
SET CONSTRAINTS "posthog_propertydefi_project_id_d3eb982d_fk_posthog_p" IMMEDIATE;""", | ||
reverse_sql=""" | ||
ALTER TABLE "posthog_eventdefinition" DROP COLUMN IF EXISTS "project_id"; | ||
ALTER TABLE "posthog_eventproperty" DROP COLUMN IF EXISTS "project_id"; | ||
ALTER TABLE "posthog_propertydefinition" DROP COLUMN IF EXISTS "project_id";""", | ||
), | ||
# We add CONCURRENTLY to the CREATE INDEX commands | ||
migrations.RunSQL( | ||
""" | ||
CREATE INDEX CONCURRENTLY "posthog_eventdefinition_project_id_f93fcbb0" ON "posthog_eventdefinition" ("project_id"); | ||
CREATE INDEX CONCURRENTLY "posthog_eventproperty_project_id_dd2337d2" ON "posthog_eventproperty" ("project_id"); | ||
CREATE INDEX CONCURRENTLY "posthog_propertydefinition_project_id_d3eb982d" ON "posthog_propertydefinition" ("project_id");""", | ||
reverse_sql=""" | ||
DROP INDEX IF EXISTS "posthog_eventdefinition_project_id_f93fcbb0"; | ||
DROP INDEX IF EXISTS "posthog_eventproperty_project_id_dd2337d2"; | ||
DROP INDEX IF EXISTS "posthog_propertydefinition_project_id_d3eb982d";""", | ||
), | ||
], | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0522_datawarehouse_salesforce_opportunity | ||
0523_project_field_in_taxonomy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters