Add progress bar model

This commit is contained in:
Javi Martín
2019-01-04 14:42:46 +01:00
committed by decabeza
parent c3c9b02220
commit eaea95ccfb
9 changed files with 205 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
class CreateProgressBars < ActiveRecord::Migration
def change
create_table :progress_bars do |t|
t.integer :kind
t.integer :percentage
t.references :progressable, polymorphic: true
t.timestamps null: false
end
reversible do |change|
change.up do
ProgressBar.create_translation_table!({
title: :string
})
end
change.down do
ProgressBar.drop_translation_table!
end
end
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: 20181206153510) do
ActiveRecord::Schema.define(version: 20190103132925) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1088,6 +1088,26 @@ ActiveRecord::Schema.define(version: 20181206153510) do
add_index "polls", ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at", using: :btree
create_table "progress_bar_translations", force: :cascade do |t|
t.integer "progress_bar_id", null: false
t.string "locale", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "title"
end
add_index "progress_bar_translations", ["locale"], name: "index_progress_bar_translations_on_locale", using: :btree
add_index "progress_bar_translations", ["progress_bar_id"], name: "index_progress_bar_translations_on_progress_bar_id", using: :btree
create_table "progress_bars", force: :cascade do |t|
t.integer "kind"
t.integer "percentage"
t.integer "progressable_id"
t.string "progressable_type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "proposal_notifications", force: :cascade do |t|
t.string "title"
t.text "body"