From d94e15cd94e94e1340eb3af413881761b7cda10c Mon Sep 17 00:00:00 2001 From: Wen Date: Tue, 6 May 2014 15:15:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=89=93=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/test/index.html.erb | 6 +- db/migrate/20140505082635_drop_user_scores.rb | 5 ++ .../20140505083218_create_user_levels.rb | 8 +++ .../20140505083430_create_user_scores.rb | 11 +++ db/schema.rb | 70 ++++++++++++++++--- 5 files changed, 86 insertions(+), 14 deletions(-) create mode 100644 db/migrate/20140505082635_drop_user_scores.rb create mode 100644 db/migrate/20140505083218_create_user_levels.rb create mode 100644 db/migrate/20140505083430_create_user_scores.rb diff --git a/app/views/test/index.html.erb b/app/views/test/index.html.erb index 17c7089d1..de889b15b 100644 --- a/app/views/test/index.html.erb +++ b/app/views/test/index.html.erb @@ -1,12 +1,12 @@

test

-<% users = User.all%> +<% user = User.find(1)%> -<% users.each do |user| %> + @@ -22,7 +22,7 @@ -<% end %> +
idnameCISfilecountissuecountlevelattachconut
<%= calculate_attachments(user) %>

diff --git a/db/migrate/20140505082635_drop_user_scores.rb b/db/migrate/20140505082635_drop_user_scores.rb new file mode 100644 index 000000000..fc65788f2 --- /dev/null +++ b/db/migrate/20140505082635_drop_user_scores.rb @@ -0,0 +1,5 @@ +class DropUserScores < ActiveRecord::Migration + def change + drop_table :user_scores + end +end diff --git a/db/migrate/20140505083218_create_user_levels.rb b/db/migrate/20140505083218_create_user_levels.rb new file mode 100644 index 000000000..f0e201212 --- /dev/null +++ b/db/migrate/20140505083218_create_user_levels.rb @@ -0,0 +1,8 @@ +class CreateUserLevels < ActiveRecord::Migration + def change + create_table :user_levels do |t| + t.integer :user_id + t.integer :level + end + end +end diff --git a/db/migrate/20140505083430_create_user_scores.rb b/db/migrate/20140505083430_create_user_scores.rb new file mode 100644 index 000000000..6c63aa327 --- /dev/null +++ b/db/migrate/20140505083430_create_user_scores.rb @@ -0,0 +1,11 @@ +class CreateUserScores < ActiveRecord::Migration + def change + create_table :user_scores do |t| + t.integer :user_id + t.integer :collaboration + t.integer :influence + t.integer :skill + t.integer :activity + end + end +end diff --git a/db/schema.rb b/db/schema.rb index fe23a1caa..2dd0f1515 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140428013546) do +ActiveRecord::Schema.define(:version => 20140505083430) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -23,6 +23,15 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + create_table "apply_project_masters", :force => true do |t| + t.integer "user_id" + t.string "apply_type" + t.integer "apply_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "attachments", :force => true do |t| t.integer "container_id" t.string "container_type", :limit => 30 @@ -518,6 +527,14 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "news", ["created_on"], :name => "index_news_on_created_on" add_index "news", ["project_id"], :name => "news_project_id" + create_table "no_uses", :force => true do |t| + t.integer "user_id", :null => false + t.string "no_use_type" + t.integer "no_use_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "open_id_authentication_associations", :force => true do |t| t.integer "issued" t.integer "lifetime" @@ -533,6 +550,19 @@ ActiveRecord::Schema.define(:version => 20140428013546) do t.string "salt", :null => false end + create_table "open_source_projects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "commit_count", :default => 0 + t.integer "code_line", :default => 0 + t.integer "users_count", :default => 0 + t.date "last_commit_time" + t.string "url" + t.date "date_collected" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "praise_tread_caches", :force => true do |t| t.integer "object_id", :null => false t.string "object_type" @@ -612,6 +642,24 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "queries", ["project_id"], :name => "index_queries_on_project_id" add_index "queries", ["user_id"], :name => "index_queries_on_user_id" + create_table "relative_memos", :force => true do |t| + t.integer "osp_id", :null => false + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :null => false + t.integer "author_id" + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 + t.string "url" + end + create_table "repositories", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "url", :default => "", :null => false @@ -810,6 +858,11 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" + create_table "user_levels", :force => true do |t| + t.integer "user_id" + t.integer "level" + end + create_table "user_preferences", :force => true do |t| t.integer "user_id", :default => 0, :null => false t.text "others" @@ -820,16 +873,11 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false - t.integer "collaboration" - t.integer "influence" - t.integer "skill" - t.integer "active" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "level" - t.integer "file" - t.integer "issue" + t.integer "user_id" + t.integer "collaboration" + t.integer "influence" + t.integer "skill" + t.integer "activity" end create_table "user_statuses", :force => true do |t|