Sha256: 327fe7992e1f2c87c09cba1b4f74a3640ec58562fcbc8908827170c381fba121

Contents?: true

Size: 1.92 KB

Versions: 8

Compression:

Stored size: 1.92 KB

Contents

class CreateEffectivePolls < ActiveRecord::Migration[6.0]
  def change
    create_table <%= @polls_table_name %> do |t|
      t.string :title

      t.string :token
      t.datetime :start_at
      t.datetime :end_at

      t.string :audience
      t.text :audience_scope

      t.datetime :updated_at
      t.datetime :created_at
    end

    create_table <%= @poll_notifications_table_name %> do |t|
      t.references :poll

      t.string :category
      t.integer :reminder

      t.string :from
      t.string :subject
      t.text :body

      t.datetime :started_at
      t.datetime :completed_at

      t.datetime :updated_at
      t.datetime :created_at
    end

    create_table <%= @poll_questions_table_name %> do |t|
      t.references :poll

      t.string :title
      t.string :category
      t.boolean :required, default: true

      t.integer :position

      t.datetime :updated_at
      t.datetime :created_at
    end

    create_table <%= @poll_question_options_table_name %> do |t|
      t.references :poll_question

      t.string :title
      t.integer :position

      t.datetime :updated_at
      t.datetime :created_at
    end

    create_table <%= @ballots_table_name %> do |t|
      t.references :poll
      t.references :user

      t.string :token
      t.text :wizard_steps
      t.datetime :completed_at

      t.datetime :updated_at
      t.datetime :created_at
    end

    create_table <%= @ballot_responses_table_name %> do |t|
      t.references :ballot
      t.references :poll
      t.references :poll_question

      t.date :date
      t.string :email
      t.integer :number
      t.text :long_answer
      t.text :short_answer

      t.datetime :updated_at
      t.datetime :created_at
    end

    create_table <%= @ballot_response_options_table_name %> do |t|
      t.references :ballot_response
      t.references :poll_question_option

      t.datetime :updated_at
      t.datetime :created_at
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
effective_polls-0.2.0 db/migrate/01_create_effective_polls.rb.erb
effective_polls-0.1.6 db/migrate/01_create_effective_polls.rb.erb
effective_polls-0.1.5 db/migrate/01_create_effective_polls.rb.erb
effective_polls-0.1.4 db/migrate/01_create_effective_polls.rb.erb
effective_polls-0.1.3 db/migrate/01_create_effective_polls.rb.erb
effective_polls-0.1.2 db/migrate/01_create_effective_polls.rb.erb
effective_polls-0.1.1 db/migrate/01_create_effective_polls.rb.erb
effective_polls-0.1.0 db/migrate/01_create_effective_polls.rb.erb