Fix migration and model for storages

pull/10133/head
Wieland Lindenthal 3 years ago
parent 8c1895eac7
commit 48e9b12a15
No known key found for this signature in database
GPG Key ID: 7ACCABE64832A0C6
  1. 5
      db/migrate/20220113144323_create_storage.rb
  2. 1
      modules/storages/app/models/storages/storage.rb

@ -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
end
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

Loading…
Cancel
Save