From 558100c35e552983d67146a7fcda4f01ffa30784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sun, 3 Sep 2023 15:28:32 +0200 Subject: [PATCH] Fix migration failing with PostgreSQL --- .../20230312212030_create_remote_storage_authorizations.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/migrate/20230312212030_create_remote_storage_authorizations.rb b/db/migrate/20230312212030_create_remote_storage_authorizations.rb index ebb8733..4c0330f 100644 --- a/db/migrate/20230312212030_create_remote_storage_authorizations.rb +++ b/db/migrate/20230312212030_create_remote_storage_authorizations.rb @@ -1,9 +1,12 @@ class CreateRemoteStorageAuthorizations < ActiveRecord::Migration[7.0] def change + db_type = ActiveRecord::Base.configurations.find_db_config(Rails.env).adapter + array_default = db_type == "postgresql" ? [] : [].to_yaml + create_table :remote_storage_authorizations do |t| t.references :user, null: false, foreign_key: true t.string :token - t.text :permissions, array: true, default: [].to_yaml + t.text :permissions, array: true, default: array_default t.string :client_id t.string :redirect_uri t.string :app_name