mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add surveys; custom generated by admins
Available during registration or after conference Co-authored-by: Shyukri <shshyukriev@suse.com> Co-authored-by: Henne <hvogel@opensuse.org> Co-authored-by: Moises <mdeniz@suse.com>
This commit is contained in:
parent
4e742d170f
commit
9f3c0eff5d
43 changed files with 701 additions and 17 deletions
13
db/migrate/20160627122446_create_surveys.rb
Normal file
13
db/migrate/20160627122446_create_surveys.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class CreateSurveys < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :surveys do |t|
|
||||
t.datetime :start_date
|
||||
t.datetime :end_date
|
||||
t.string :title
|
||||
t.text :description
|
||||
t.references :surveyable, polymorphic: true, index: true
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
13
db/migrate/20160628093634_create_survey_questions.rb
Normal file
13
db/migrate/20160628093634_create_survey_questions.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class CreateSurveyQuestions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :survey_questions do |t|
|
||||
t.references :survey
|
||||
t.string :title
|
||||
t.integer :kind, default: 0
|
||||
t.integer :min_choices
|
||||
t.integer :max_choices
|
||||
t.text :possible_answers
|
||||
t.boolean :mandatory, default: false
|
||||
end
|
||||
end
|
||||
end
|
||||
5
db/migrate/20160629145954_add_target_to_surveys.rb
Normal file
5
db/migrate/20160629145954_add_target_to_surveys.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddTargetToSurveys < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :surveys, :target, :integer, default: 0
|
||||
end
|
||||
end
|
||||
11
db/migrate/20160630094850_create_survey_replies.rb
Normal file
11
db/migrate/20160630094850_create_survey_replies.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class CreateSurveyReplies < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :survey_replies do |t|
|
||||
t.integer :survey_question_id
|
||||
t.integer :user_id
|
||||
t.text :text
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
10
db/migrate/20160630130731_create_survey_submissions.rb
Normal file
10
db/migrate/20160630130731_create_survey_submissions.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class CreateSurveySubmissions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :survey_submissions do |t|
|
||||
t.integer :user_id
|
||||
t.integer :survey_id
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
39
db/schema.rb
39
db/schema.rb
|
|
@ -482,6 +482,45 @@ ActiveRecord::Schema.define(version: 20180316220446) do
|
|||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "survey_questions", force: :cascade do |t|
|
||||
t.integer "survey_id"
|
||||
t.string "title"
|
||||
t.integer "kind", default: 0
|
||||
t.integer "min_choices"
|
||||
t.integer "max_choices"
|
||||
t.text "possible_answers"
|
||||
t.boolean "mandatory", default: false
|
||||
end
|
||||
|
||||
create_table "survey_replies", force: :cascade do |t|
|
||||
t.integer "survey_question_id"
|
||||
t.integer "user_id"
|
||||
t.text "text"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "survey_submissions", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "survey_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "surveys", force: :cascade do |t|
|
||||
t.datetime "start_date"
|
||||
t.datetime "end_date"
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
t.integer "surveyable_id"
|
||||
t.string "surveyable_type"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "target", default: 0
|
||||
end
|
||||
|
||||
add_index "surveys", ["surveyable_type", "surveyable_id"], name: "index_surveys_on_surveyable_type_and_surveyable_id"
|
||||
|
||||
create_table "targets", force: :cascade do |t|
|
||||
t.integer "conference_id"
|
||||
t.integer "campaign_id"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue