diff --git a/app/models/apply_forum.rb b/app/models/apply_forum.rb new file mode 100644 index 00000000..1457f9bf --- /dev/null +++ b/app/models/apply_forum.rb @@ -0,0 +1,2 @@ +class ApplyForum < ApplicationRecord +end diff --git a/app/models/banned_forum.rb b/app/models/banned_forum.rb new file mode 100644 index 00000000..1fa372d0 --- /dev/null +++ b/app/models/banned_forum.rb @@ -0,0 +1,2 @@ +class BannedForum < ApplicationRecord +end diff --git a/app/models/forum_moderator.rb b/app/models/forum_moderator.rb new file mode 100644 index 00000000..5d0c29d0 --- /dev/null +++ b/app/models/forum_moderator.rb @@ -0,0 +1,2 @@ +class ForumModerator < ApplicationRecord +end diff --git a/app/models/forum_section.rb b/app/models/forum_section.rb new file mode 100644 index 00000000..db05e78b --- /dev/null +++ b/app/models/forum_section.rb @@ -0,0 +1,2 @@ +class ForumSection < ApplicationRecord +end diff --git a/app/models/memo.rb b/app/models/memo.rb new file mode 100644 index 00000000..1094bca0 --- /dev/null +++ b/app/models/memo.rb @@ -0,0 +1,2 @@ +class Memo < ApplicationRecord +end diff --git a/app/models/memo_forum.rb b/app/models/memo_forum.rb new file mode 100644 index 00000000..0fef720d --- /dev/null +++ b/app/models/memo_forum.rb @@ -0,0 +1,2 @@ +class MemoForum < ApplicationRecord +end diff --git a/app/models/section_notice.rb b/app/models/section_notice.rb new file mode 100644 index 00000000..29148932 --- /dev/null +++ b/app/models/section_notice.rb @@ -0,0 +1,2 @@ +class SectionNotice < ApplicationRecord +end diff --git a/app/models/visit_action.rb b/app/models/visit_action.rb new file mode 100644 index 00000000..b439de0a --- /dev/null +++ b/app/models/visit_action.rb @@ -0,0 +1,2 @@ +class VisitAction < ApplicationRecord +end diff --git a/db/migrate/20201012055111_create_memos.rb b/db/migrate/20201012055111_create_memos.rb new file mode 100644 index 00000000..08f5f0fa --- /dev/null +++ b/db/migrate/20201012055111_create_memos.rb @@ -0,0 +1,37 @@ +class CreateMemos < ActiveRecord::Migration[5.2] + def change + create_table :memos do |t| + t.integer :forum_id, :null => false + t.integer :parent_id, null: true + t.string :subject, null: false + t.text :content, null: false + t.integer :author_id, null: false + t.integer :replies_count, default: 0 + t.integer :last_reply_id + t.boolean :lock, default: false + t.boolean :sticky, default: false + t.integer :viewed_count, :default => 0 + t.integer :root_id + t.integer :reward + t.string :language + t.boolean :hidden, :default => true + t.string :repertoire_name + t.boolean :is_md, :default => true + t.datetime :published_at + t.boolean :homepage_show, :default => false + t.integer :praises_count, :default => 0 + t.boolean :is_fine, :default => false + t.datetime :last_reply_on + t.integer :tag_id, :default => 1 + t.boolean :is_original + t.string :reprint_link + t.integer :forum_section_id + t.integer :destroy_status + t.timestamps + end + add_index :memos, :forum_id + add_index :memos, :author_id + add_index :memos, :forum_section_id + add_index :memos, :destroy_status + end +end diff --git a/db/migrate/20201012055318_create_memo_forums.rb b/db/migrate/20201012055318_create_memo_forums.rb new file mode 100644 index 00000000..2c1aaffb --- /dev/null +++ b/db/migrate/20201012055318_create_memo_forums.rb @@ -0,0 +1,13 @@ +class CreateMemoForums < ActiveRecord::Migration[5.2] + def change + create_table :memo_forums do |t| + t.integer :memo_id + t.integer :forum_id + t.boolean :is_children, :default => false + t.timestamps + end + add_index :memo_forums, :memo_id + add_index :memo_forums, :forum_id + add_index :memo_forums, :is_children + end +end diff --git a/db/migrate/20201012055735_create_forum_sections.rb b/db/migrate/20201012055735_create_forum_sections.rb new file mode 100644 index 00000000..f09b7e9e --- /dev/null +++ b/db/migrate/20201012055735_create_forum_sections.rb @@ -0,0 +1,22 @@ +class CreateForumSections < ActiveRecord::Migration[5.2] + def change + create_table :forum_sections do |t| + t.integer "user_id" + t.string "title" + t.integer "position", :default => 0 + t.integer "parent_id" + t.integer "is_recommend", :default => 0 + t.string "ancestry" + t.integer "attachment_id" + t.text "description" + t.integer "memos_count", :default => 0 + t.integer "watchers_count", :default => 0 + t.timestamps + end + add_index :forum_sections, :user_id + add_index :forum_sections, :title + add_index :forum_sections, :position + add_index :forum_sections, :ancestry + + end +end diff --git a/db/migrate/20201012060029_create_forum_moderators.rb b/db/migrate/20201012060029_create_forum_moderators.rb new file mode 100644 index 00000000..f10e415d --- /dev/null +++ b/db/migrate/20201012060029_create_forum_moderators.rb @@ -0,0 +1,13 @@ +class CreateForumModerators < ActiveRecord::Migration[5.2] + def change + create_table :forum_moderators do |t| + t.integer "user_id" + t.integer "forum_section_id" + t.boolean "is_children", :default => false + t.timestamps + end + add_index :forum_moderators, :user_id + add_index :forum_moderators, :forum_section_id + add_index :forum_moderators, :is_children + end +end diff --git a/db/migrate/20201012060303_create_section_notices.rb b/db/migrate/20201012060303_create_section_notices.rb new file mode 100644 index 00000000..4b81dc9c --- /dev/null +++ b/db/migrate/20201012060303_create_section_notices.rb @@ -0,0 +1,12 @@ +class CreateSectionNotices < ActiveRecord::Migration[5.2] + def change + create_table :section_notices do |t| + t.integer "user_id" + t.integer "forum_section_id" + t.text "content" + t.timestamps + end + add_index :section_notices, :user_id + add_index :section_notices, :forum_section_id + end +end diff --git a/db/migrate/20201012060408_create_apply_forums.rb b/db/migrate/20201012060408_create_apply_forums.rb new file mode 100644 index 00000000..c1606a69 --- /dev/null +++ b/db/migrate/20201012060408_create_apply_forums.rb @@ -0,0 +1,16 @@ +class CreateApplyForums < ActiveRecord::Migration[5.2] + def change + create_table :apply_forums do |t| + t.integer "user_id" + t.string "user_ip" + t.integer "forum_section_id" + t.integer "is_confirm", :default => 0 + t.integer "confirm_user_id" + t.datetime "deal_time" + t.timestamps + end + add_index :apply_forums, :user_id + add_index :apply_forums, :forum_section_id + add_index :apply_forums, :is_confirm + end +end diff --git a/db/migrate/20201012060542_create_banned_forums.rb b/db/migrate/20201012060542_create_banned_forums.rb new file mode 100644 index 00000000..6774d145 --- /dev/null +++ b/db/migrate/20201012060542_create_banned_forums.rb @@ -0,0 +1,15 @@ +class CreateBannedForums < ActiveRecord::Migration[5.2] + def change + create_table :banned_forums do |t| + t.integer "user_id" + t.integer "author_id" + t.integer "memo_id" + t.integer "banned_count", :default => 0 + t.boolean "is_banned", :default => false + t.timestamps + end + add_index :banned_forums, :user_id + add_index :banned_forums, :author_id + add_index :banned_forums, :memo_id + end +end diff --git a/db/migrate/20201012060653_create_visit_actions.rb b/db/migrate/20201012060653_create_visit_actions.rb new file mode 100644 index 00000000..5c820b5a --- /dev/null +++ b/db/migrate/20201012060653_create_visit_actions.rb @@ -0,0 +1,14 @@ +class CreateVisitActions < ActiveRecord::Migration[5.2] + def change + create_table :visit_actions do |t| + t.integer :visitable_id + t.string :visitable_type + t.integer :user_id + t.timestamps + end + add_index :visit_actions, :user_id + add_index :visit_actions, [:visitable_type, :visitable_id] + add_index :visit_actions,[:visitable_id,:user_id] + + end +end diff --git a/spec/models/apply_forum_spec.rb b/spec/models/apply_forum_spec.rb new file mode 100644 index 00000000..f2ff2f35 --- /dev/null +++ b/spec/models/apply_forum_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe ApplyForum, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/banned_forum_spec.rb b/spec/models/banned_forum_spec.rb new file mode 100644 index 00000000..994189de --- /dev/null +++ b/spec/models/banned_forum_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe BannedForum, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/forum_moderator_spec.rb b/spec/models/forum_moderator_spec.rb new file mode 100644 index 00000000..57e11c8b --- /dev/null +++ b/spec/models/forum_moderator_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe ForumModerator, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/forum_section_spec.rb b/spec/models/forum_section_spec.rb new file mode 100644 index 00000000..96e1dddc --- /dev/null +++ b/spec/models/forum_section_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe ForumSection, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/memo_forum_spec.rb b/spec/models/memo_forum_spec.rb new file mode 100644 index 00000000..3a73e6f2 --- /dev/null +++ b/spec/models/memo_forum_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe MemoForum, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/section_notice_spec.rb b/spec/models/section_notice_spec.rb new file mode 100644 index 00000000..a8916cf6 --- /dev/null +++ b/spec/models/section_notice_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe SectionNotice, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/visit_action_spec.rb b/spec/models/visit_action_spec.rb new file mode 100644 index 00000000..4f950dd6 --- /dev/null +++ b/spec/models/visit_action_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe VisitAction, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end