<filename>hasura/migrations/carnet_de_bord/1635250408042_remove_target_id_column_in_action/down.sql<gh_stars>1-10
alter table "public"."ref_action" drop column "theme";

alter table "public"."ref_action" add column "target_id" uuid not null;

alter table "public"."ref_action"
  add constraint "ref_action_target_id_fkey"
  foreign key ("target_id")
  references "public"."ref_target"
  ("id") on update restrict on delete cascade;

alter table "public"."ref_target" alter column "theme" drop not null;