Ajout du model expert
Co-authored-by: Kara Diaby <kdiaby.pro@gmail.com>
This commit is contained in:
parent
f698dc798c
commit
29e9f2dd32
5 changed files with 35 additions and 1 deletions
7
db/migrate/20210107143316_create_experts.rb
Normal file
7
db/migrate/20210107143316_create_experts.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class CreateExperts < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :experts do |t| # rubocop:disable Style/SymbolProc
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
6
db/migrate/20210107143938_link_user_and_expert.rb
Normal file
6
db/migrate/20210107143938_link_user_and_expert.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class LinkUserAndExpert < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_reference :users, :expert, index: true
|
||||
add_foreign_key :users, :experts
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue