This commit is contained in:
Moisés Déniz Alemán 2016-06-30 10:43:49 +00:00 committed by GitHub
commit fdec9fe035
31 changed files with 603 additions and 23 deletions

View 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

View 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

View file

@ -0,0 +1,5 @@
class AddTargetToSurveys < ActiveRecord::Migration
def change
add_column :surveys, :target, :integer, default: 0
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160624151257) do
ActiveRecord::Schema.define(version: 20160629145954) do
create_table "ahoy_events", force: :cascade do |t|
t.uuid "visit_id", limit: 16
@ -80,23 +80,23 @@ ActiveRecord::Schema.define(version: 20160624151257) do
end
create_table "conferences", force: :cascade do |t|
t.string "guid", null: false
t.string "title", null: false
t.string "short_title", null: false
t.string "timezone", null: false
t.date "start_date", null: false
t.date "end_date", null: false
t.string "guid", null: false
t.string "title", null: false
t.string "short_title", null: false
t.string "timezone", null: false
t.date "start_date", null: false
t.date "end_date", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "logo_file_name"
t.integer "revision"
t.boolean "use_vpositions", default: false
t.boolean "use_vdays", default: false
t.boolean "use_vpositions", default: false
t.boolean "use_vdays", default: false
t.boolean "use_volunteers"
t.string "color"
t.text "events_per_week"
t.text "description"
t.integer "registration_limit", default: 0
t.integer "registration_limit", default: 0
t.string "picture"
end
@ -379,6 +379,30 @@ ActiveRecord::Schema.define(version: 20160624151257) 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 "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"