Archived
Added messaging feature
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class CreateMessages < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :messages do |t|
|
||||
|
||||
t.text :message
|
||||
t.references :user_sender
|
||||
t.references :user_target
|
||||
t.datetime :created_at
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class ChangeMessageToText < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :messages, :message, :text
|
||||
end
|
||||
end
|
||||
+32
-25
@@ -11,10 +11,10 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160926220738) do
|
||||
ActiveRecord::Schema.define(version: 20170525184355) do
|
||||
|
||||
create_table "blogposts", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.string "title", limit: 191
|
||||
t.text "content", limit: 65535
|
||||
t.integer "user_author_id", limit: 4
|
||||
t.integer "user_editor_id", limit: 4
|
||||
@@ -32,14 +32,14 @@ ActiveRecord::Schema.define(version: 20160926220738) do
|
||||
end
|
||||
|
||||
create_table "forumgroups", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "name", limit: 191
|
||||
t.integer "position", limit: 4
|
||||
t.integer "role_read_id", limit: 4
|
||||
t.integer "role_write_id", limit: 4
|
||||
end
|
||||
|
||||
create_table "forums", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "name", limit: 191
|
||||
t.integer "position", limit: 4
|
||||
t.integer "role_read_id", limit: 4
|
||||
t.integer "role_write_id", limit: 4
|
||||
@@ -52,7 +52,7 @@ ActiveRecord::Schema.define(version: 20160926220738) do
|
||||
end
|
||||
|
||||
create_table "forumthreads", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.string "title", limit: 191
|
||||
t.text "content", limit: 65535
|
||||
t.boolean "sticky", default: false
|
||||
t.boolean "locked", default: false
|
||||
@@ -65,33 +65,40 @@ ActiveRecord::Schema.define(version: 20160926220738) do
|
||||
end
|
||||
|
||||
create_table "info", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.string "title", limit: 191
|
||||
t.text "content", limit: 65535
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "labels", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "color"
|
||||
t.string "name", limit: 191
|
||||
t.string "color", limit: 191
|
||||
end
|
||||
|
||||
create_table "messages", force: :cascade do |t|
|
||||
t.text "text", limit: 65535
|
||||
t.integer "user_sender_id", limit: 4
|
||||
t.integer "user_target_id", limit: 4
|
||||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
create_table "register_tokens", force: :cascade do |t|
|
||||
t.string "uuid", null: false
|
||||
t.string "token", null: false
|
||||
t.string "email", null: false
|
||||
t.string "uuid", limit: 32, null: false
|
||||
t.string "token", limit: 6, null: false
|
||||
t.string "email", limit: 191, null: false
|
||||
end
|
||||
|
||||
add_index "register_tokens", ["uuid"], name: "index_register_tokens_on_uuid", unique: true, using: :btree
|
||||
|
||||
create_table "roles", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "name", limit: 191
|
||||
t.integer "value", limit: 4
|
||||
t.string "color"
|
||||
t.string "color", limit: 191
|
||||
end
|
||||
|
||||
create_table "sessions", force: :cascade do |t|
|
||||
t.string "session_id", null: false
|
||||
t.string "session_id", limit: 191, null: false
|
||||
t.text "data", limit: 65535
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
@@ -110,20 +117,20 @@ ActiveRecord::Schema.define(version: 20160926220738) do
|
||||
end
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "uuid", null: false
|
||||
t.string "name", null: false
|
||||
t.string "password_digest", null: false
|
||||
t.string "ign", null: false
|
||||
t.string "email", null: false
|
||||
t.string "uuid", limit: 191, null: false
|
||||
t.string "name", limit: 191, null: false
|
||||
t.string "password_digest", limit: 191, null: false
|
||||
t.string "ign", limit: 191, null: false
|
||||
t.string "email", limit: 191, null: false
|
||||
t.text "about", limit: 65535
|
||||
t.string "last_ip"
|
||||
t.string "skype"
|
||||
t.string "last_ip", limit: 191
|
||||
t.string "skype", limit: 191
|
||||
t.boolean "skype_public", default: false
|
||||
t.string "youtube"
|
||||
t.string "youtube_channelname"
|
||||
t.string "twitter"
|
||||
t.string "youtube", limit: 191
|
||||
t.string "youtube_channelname", limit: 191
|
||||
t.string "twitter", limit: 191
|
||||
t.boolean "donor", default: false
|
||||
t.string "email_token"
|
||||
t.string "email_token", limit: 191
|
||||
t.boolean "confirmed", default: false
|
||||
t.datetime "last_seen"
|
||||
t.integer "role_id", limit: 4, null: false
|
||||
|
||||
+25
-1
@@ -38,4 +38,28 @@ User.create!(
|
||||
password: "123456789", # high seructity!
|
||||
password_confirmation: "123456789",
|
||||
role: Role.get(:superadmin)
|
||||
)
|
||||
)
|
||||
User.create!(
|
||||
uuid: "7f52491ab5d64c11b4a43806db47a101",
|
||||
ign: "Yummy_",
|
||||
name: "Yummy",
|
||||
email: "yummy@example.com",
|
||||
password: "123456789", # high seructity!
|
||||
password_confirmation: "123456789",
|
||||
role: Role.get(:superadmin)
|
||||
)
|
||||
User.create!(
|
||||
uuid: "62fe35da05ae437ea44b4deae1be1dc4",
|
||||
ign: "Logal",
|
||||
email: "logal@example.com",
|
||||
password: "123456789", # high seructity!
|
||||
password_confirmation: "123456789",
|
||||
role: Role.get(:superadmin)
|
||||
)
|
||||
|
||||
Message.create!(
|
||||
user_sender_id: 2,
|
||||
user_target_id: 2,
|
||||
text: "This is a very long message that I will be using to test a plentitude of things. :)",
|
||||
created_at: Time.utc(0).to_datetime
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user