Fix migration failing with PostgreSQL
This commit is contained in:
parent
6739b38f4c
commit
558100c35e
@ -1,9 +1,12 @@
|
|||||||
class CreateRemoteStorageAuthorizations < ActiveRecord::Migration[7.0]
|
class CreateRemoteStorageAuthorizations < ActiveRecord::Migration[7.0]
|
||||||
def change
|
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|
|
create_table :remote_storage_authorizations do |t|
|
||||||
t.references :user, null: false, foreign_key: true
|
t.references :user, null: false, foreign_key: true
|
||||||
t.string :token
|
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 :client_id
|
||||||
t.string :redirect_uri
|
t.string :redirect_uri
|
||||||
t.string :app_name
|
t.string :app_name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user