diff --git a/hasura.planx.uk/migrations/1711637066987_alter_table_public_analytics_logs_default_allow_list_answers_to_null/down.sql b/hasura.planx.uk/migrations/1711637066987_alter_table_public_analytics_logs_default_allow_list_answers_to_null/down.sql new file mode 100644 index 0000000000..8d16a24f0e --- /dev/null +++ b/hasura.planx.uk/migrations/1711637066987_alter_table_public_analytics_logs_default_allow_list_answers_to_null/down.sql @@ -0,0 +1,3 @@ +alter table "public"."analytics_logs" alter column "allow_list_answers" set default '[]'::jsonb; + +UPDATE public.analytics_logs SET allow_list_answers = '[]'::jsonb WHERE allow_list_answers IS NULL; diff --git a/hasura.planx.uk/migrations/1711637066987_alter_table_public_analytics_logs_default_allow_list_answers_to_null/up.sql b/hasura.planx.uk/migrations/1711637066987_alter_table_public_analytics_logs_default_allow_list_answers_to_null/up.sql new file mode 100644 index 0000000000..c38f9be1db --- /dev/null +++ b/hasura.planx.uk/migrations/1711637066987_alter_table_public_analytics_logs_default_allow_list_answers_to_null/up.sql @@ -0,0 +1,3 @@ +ALTER TABLE "public"."analytics_logs" ALTER COLUMN "allow_list_answers" drop default; + +UPDATE "public"."analytics_logs" SET allow_list_answers = NULL WHERE allow_list_answers = '[]'::jsonb; \ No newline at end of file