mirror of https://github.com/docusealco/docuseal
parent
82f3ff4824
commit
01232aed5a
@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: account_accesses
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# account_id :bigint not null
|
||||
# user_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_account_accesses_on_account_id_and_user_id (account_id,user_id) UNIQUE
|
||||
#
|
||||
# Foreign Keys
|
||||
#
|
||||
# fk_rails_... (account_id => accounts.id)
|
||||
#
|
||||
class AccountAccess < ApplicationRecord
|
||||
belongs_to :account
|
||||
belongs_to :user
|
||||
end
|
||||
@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AccountAccesses < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :account_accesses do |t|
|
||||
t.references :account, null: false, foreign_key: true, index: false
|
||||
t.references :user, null: false, foreign_key: false, index: false
|
||||
|
||||
t.index %i[account_id user_id], unique: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in new issue