From 00b0fc4c14c3bdf728751a1ead2629424753aa69 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sun, 11 Jan 2015 12:30:05 -0500 Subject: [PATCH] Add primary keys using our naming scheme. --- scripts/gen_partitions.shl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gen_partitions.shl b/scripts/gen_partitions.shl index 47583ae..4a76742 100755 --- a/scripts/gen_partitions.shl +++ b/scripts/gen_partitions.shl @@ -33,8 +33,8 @@ do if [[ $table = "games" ]] then printf "CREATE INDEX %s_%s%s_ix002 on %s_%s%s using gin(players);\n" $table $year $qtr $table $year $qtr - # TODO(divVerent): This index probably should be a primary key instead. - printf "CREATE INDEX %s_%s%s_ix003 on %s_%s%s(game_id);\n" $table $year $qtr $table $year $qtr + printf "CREATE UNIQUE INDEX %s_%s%s_pk on %s_%s%s(game_id);\n" $table $year $qtr $table $year $qtr + printf "ALTER TABLE %s_%s%s ADD PRIMARY KEY USING INDEX %s_%s%s_pk;\n" $table $year $qtr $table $year $qtr fi if [[ $table = "player_game_stats" || $table = "player_weapon_stats" ]] -- 2.39.2