Generate initial models
This commit is contained in:
commit
3e1e5618ca
89 changed files with 2706 additions and 0 deletions
10
db/migrate/20250426173422_create_sections.rb
Normal file
10
db/migrate/20250426173422_create_sections.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class CreateSections < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :sections do |t|
|
||||
t.text :title, null: false
|
||||
t.text :description, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
11
db/migrate/20250426173508_create_questions.rb
Normal file
11
db/migrate/20250426173508_create_questions.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class CreateQuestions < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :questions do |t|
|
||||
t.references :section, null: false, foreign_key: true
|
||||
t.text :text, null: false
|
||||
t.integer :type, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
10
db/migrate/20250426173634_create_answers.rb
Normal file
10
db/migrate/20250426173634_create_answers.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class CreateAnswers < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :answers do |t|
|
||||
t.references :question, null: false, foreign_key: true
|
||||
t.text :data, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue