Add Language model and LanguageController

This commit is contained in:
maddiebaka
2023-10-24 23:47:01 -04:00
parent ed00e69a13
commit 206c4da31f
28 changed files with 298 additions and 18 deletions

View File

@@ -0,0 +1,9 @@
class CreateLanguages < ActiveRecord::Migration[7.1]
def change
create_table :languages do |t|
t.string :name
t.timestamps
end
end
end

View File

@@ -0,0 +1,17 @@
class AddLanguageFields < ActiveRecord::Migration[7.1]
def change
create_table :language do |t|
t.string :name
t.timestamps
end
change_table :definitions do |t|
t.references :language, null: false, foreign_key: true
end
change_table :part_of_speeches do |t|
t.references :language, null: false, foreign_key: true
end
end
end