Permalink
Browse files

Add three upload stat columns to Course records

  • Loading branch information...
ragesoss committed Apr 11, 2016
1 parent 965baec commit c8ce6ab205623c732a3678c7ffa9acfcbaeb15cb
Showing with 15 additions and 1 deletion.
  1. +3 −0 app/models/course.rb
  2. +7 −0 db/migrate/20160411221821_add_upload_stats_to_course.rb
  3. +5 −1 db/schema.rb
View
@@ -15,6 +15,9 @@
# user_count :integer default(0)
# article_count :integer default(0)
# revision_count :integer default(0)
+# upload_count :integer default(0)
+# uploads_in_use_count :integer default(0)
+# upload_usages_count :integer default(0)
# slug :string(255)
# listed :boolean default(TRUE)
# signup_token :string(255)
@@ -0,0 +1,7 @@
+class AddUploadStatsToCourse < ActiveRecord::Migration
+ def change
+ add_column :courses, :upload_count, :integer, default: 0
+ add_column :courses, :uploads_in_use_count, :integer, default: 0
+ add_column :courses, :upload_usages_count, :integer, default: 0
+ end
+end
View
@@ -11,7 +11,8 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160404235251) do
+
+ActiveRecord::Schema.define(version: 20160411221821) do
create_table "articles", force: :cascade do |t|
t.string "title", limit: 255
@@ -135,6 +136,9 @@
t.integer "trained_count", limit: 4, default: 0
t.integer "cloned_status", limit: 4
t.string "type", limit: 255, default: "ClassroomProgramCourse"
+ t.integer "upload_count", limit: 4, default: 0
+ t.integer "uploads_in_use_count", limit: 4, default: 0
+ t.integer "upload_usages_count", limit: 4, default: 0
end
add_index "courses", ["slug"], name: "index_courses_on_slug", using: :btree

0 comments on commit c8ce6ab

Please sign in to comment.