Skip to content

Instantly share code, notes, and snippets.

@AlexandreProenca
Created February 8, 2019 11:32
Show Gist options
  • Save AlexandreProenca/2b80dbab575257dc80e9d5233cd1ae4b to your computer and use it in GitHub Desktop.
Save AlexandreProenca/2b80dbab575257dc80e9d5233cd1ae4b to your computer and use it in GitHub Desktop.
Quando é necessario que uma tabela seja alterada em uma transação atomica
migrations.RunSQL("""
ALTER TABLE "campaigns_groupmember"
ADD CONSTRAINT "campaigns_groupmember_parent_order_uniq"
UNIQUE USING INDEX "campaigns_groupmember_parent_order_uniq"
DEFERRABLE
INITIALLY IMMEDIATE
"""),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment