添加一张连接表relative_memo_to_open_source_projects
This commit is contained in:
parent
a07ae9be58
commit
543a199c5f
|
@ -12,7 +12,7 @@ class RelativeMemo < ActiveRecord::Base
|
|||
acts_as_taggable
|
||||
acts_as_attachable
|
||||
|
||||
validates_presence_of :osp_id, :subject
|
||||
validates_presence_of :subject
|
||||
#validates :content, presence: true
|
||||
# validates_length_of :subject, maximum: 50
|
||||
#validates_length_of :content, maximum: 3072
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
class RelativeMemoToOpenSourceProject < ActiveRecord::Base
|
||||
# attr_accessible :title, :body
|
||||
end
|
|
@ -2,6 +2,6 @@ class AddAuthorToRelativeMemo < ActiveRecord::Migration
|
|||
def change
|
||||
add_column :relative_memos, :username, :string
|
||||
add_column :relative_memos, :userhomeurl, :string
|
||||
add_column :relative_memos, :date_collected, :datetime
|
||||
add_column :relative_memos, :date_collected, :date
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
class CreateRelativeMemoToOpenSourceProjects < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :relative_memo_to_open_source_projects do |t|
|
||||
t.integer :osp_id
|
||||
t.integer :relative_memo_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
26
db/schema.rb
26
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140513073801) do
|
||||
ActiveRecord::Schema.define(:version => 20140516031200) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -52,14 +52,11 @@ ActiveRecord::Schema.define(:version => 20140513073801) do
|
|||
add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type"
|
||||
add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on"
|
||||
|
||||
create_table "attachmentstypes", :id => false, :force => true do |t|
|
||||
t.integer "id", :null => false
|
||||
t.integer "typeId"
|
||||
create_table "attachmentstypes", :force => true do |t|
|
||||
t.integer "typeId", :null => false
|
||||
t.string "typeName", :limit => 50
|
||||
end
|
||||
|
||||
add_index "attachmentstypes", ["id"], :name => "id"
|
||||
|
||||
create_table "auth_sources", :force => true do |t|
|
||||
t.string "type", :limit => 30, :default => "", :null => false
|
||||
t.string "name", :limit => 60, :default => "", :null => false
|
||||
|
@ -652,6 +649,13 @@ ActiveRecord::Schema.define(:version => 20140513073801) 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_memo_to_open_source_projects", :force => true do |t|
|
||||
t.integer "osp_id"
|
||||
t.integer "relative_memo_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "relative_memos", :force => true do |t|
|
||||
t.integer "osp_id", :null => false
|
||||
t.integer "parent_id"
|
||||
|
@ -668,6 +672,9 @@ ActiveRecord::Schema.define(:version => 20140513073801) do
|
|||
t.integer "viewed_count_crawl", :default => 0
|
||||
t.integer "viewed_count_local", :default => 0
|
||||
t.string "url"
|
||||
t.string "username"
|
||||
t.string "userhomeurl"
|
||||
t.date "date_collected"
|
||||
end
|
||||
|
||||
create_table "repositories", :force => true do |t|
|
||||
|
@ -736,11 +743,10 @@ ActiveRecord::Schema.define(:version => 20140513073801) do
|
|||
t.string "url"
|
||||
t.string "title"
|
||||
t.integer "share_type"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "project_id"
|
||||
t.integer "user_id"
|
||||
t.string "description"
|
||||
end
|
||||
|
||||
create_table "softapplications", :force => true do |t|
|
||||
|
@ -843,8 +849,8 @@ ActiveRecord::Schema.define(:version => 20140513073801) do
|
|||
t.integer "zip_code"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "technical_title"
|
||||
t.integer "identity"
|
||||
t.string "technical_title"
|
||||
t.string "student_id"
|
||||
t.string "teacher_realname"
|
||||
t.string "student_realname"
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the '{}' from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
|
@ -0,0 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RelativeMemoToOpenSourceProjectTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
Loading…
Reference in New Issue