Skip to content

Commit

Permalink
fix: create and drop temp table in migration (#1458)
Browse files Browse the repository at this point in the history
* fix: create and drop temp table in migration
  • Loading branch information
razvan-pro committed Feb 8, 2021
1 parent 2d19db7 commit dee2492
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aimmo/migrations/0024_unique_class_per_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Migration(migrations.Migration):
operations = [
migrations.RunSQL(
"""
CREATE TEMPORARY TABLE aimmo_games_to_delete AS
CREATE TEMPORARY TABLE temp.aimmo_games_to_delete AS
SELECT
id
FROM
Expand Down Expand Up @@ -42,7 +42,7 @@ class Migration(migrations.Migration):
SELECT
id
FROM
aimmo_games_to_delete);
temp.aimmo_games_to_delete);
DELETE
FROM
Expand All @@ -52,7 +52,9 @@ class Migration(migrations.Migration):
SELECT
id
FROM
aimmo_games_to_delete);
temp.aimmo_games_to_delete);
DROP TABLE temp.aimmo_games_to_delete;
""",
migrations.RunSQL.noop,
),
Expand Down

0 comments on commit dee2492

Please sign in to comment.