@ -3,12 +3,9 @@ class CreateStorage < ActiveRecord::Migration[6.1]
create_table :storages do |t|
t.string :provider_type
t.string :name
t.bigint :creator_id, null: false, foreign_key: true
t.string :identifier, null: false
t.references :creator, null: false, index: true, foreign_key: { to_table: :users }
t.timestamps
t.index :identifier
end
@ -33,7 +33,6 @@ class Storages::Storage < ApplicationRecord
belongs_to :creator, class_name: 'User'
has_many :projects_storages, dependent: :destroy, class_name: 'Storages::ProjectStorage'
has_many :projects, through: :projects_storages
has_secure_token :identifier
PROVIDER_TYPES = %w[nextcloud].freeze