3 Commits

Author SHA1 Message Date
MrYummy
4d9d4a4dfc removed unneeded parentheses and text limits 2017-08-06 13:29:03 +02:00
MrYummy
626ba221e0 Removed swap file 2017-07-11 03:38:17 +02:00
MrYummy
0cebefa406 Added permissions to badges 2017-07-10 21:26:15 +02:00
18 changed files with 171 additions and 72 deletions

View File

@@ -19,6 +19,19 @@ class ForumgroupsController < ApplicationController
def update def update
if admin? if admin?
@group = Forumgroup.find(params[:id]) @group = Forumgroup.find(params[:id])
group_badges = Badgeassociation.where(forumgroup: @group)
["read-", "write-"].each_with_index do |p,i|
current_badges = group_badges.where(permission: i+1).pluck(:badge_id)
params.select{|k,v| k.start_with? p}.each do |k,v|
name = k.gsub(p, "")
if current_badges.include? (bid = Badge.find_by(name: name).id)
current_badges.delete bid
else
Badgeassociation.create!(badge: Badge.find_by(name: name), forumgroup: @group, permission: i+1)
end
end
current_badges.each {|b| Badgeassociation.find_by(badge_id: b, forumgroup: @group, permission: i+1).delete}
end
if @group.update_attributes(group_params) if @group.update_attributes(group_params)
flash[:notice] = "Forum group updated" flash[:notice] = "Forum group updated"
redirect_to @group redirect_to @group
@@ -43,6 +56,11 @@ class ForumgroupsController < ApplicationController
def create def create
if admin? if admin?
@group = Forumgroup.new(group_params) @group = Forumgroup.new(group_params)
["read-", "write-"].each_with_index do |p,i|
params.select{|k,v| k.start_with? p}.each do |k,v|
Badgeassociation.create!(badge: Badge.find_by(name: k.gsub(p, "")), forumgroup: @group, permission: i+1)
end
end
if @group.save if @group.save
flash[:notice] = "Forum group created." flash[:notice] = "Forum group created."
redirect_to @group redirect_to @group

View File

@@ -35,6 +35,19 @@ class ForumsController < ApplicationController
def update def update
if admin? if admin?
forum_badges = Badgeassociation.where(forum: @forum)
["read-", "write-"].each_with_index do |p,i|
current_badges = forum_badges.where(permission: i+1).pluck(:badge_id)
params.select{|k,v| k.start_with? p}.each do |k,v|
name = k.gsub(p, "")
if current_badges.include? (bid = Badge.find_by(name: name).id)
current_badges.delete bid
else
Badgeassociation.create!(badge: Badge.find_by(name: name), forum: @forum, permission: i+1)
end
end
current_badges.each {|b| Badgeassociation.find_by(badge_id: b, forum: @forum, permission: i+1).delete}
end
if @forum.update_attributes(forum_params) if @forum.update_attributes(forum_params)
flash[:notice] = "Forum updated" flash[:notice] = "Forum updated"
redirect_to @forum redirect_to @forum
@@ -50,6 +63,11 @@ class ForumsController < ApplicationController
def create def create
if admin? if admin?
@forum = Forum.new(forum_params([:forumgroup_id])) @forum = Forum.new(forum_params([:forumgroup_id]))
["read-", "write-"].each_with_index do |p,i|
params.select{|k,v| k.start_with? p}.each do |k,v|
Badgeassociation.create!(badge: Badge.find_by(name: k.gsub(p, "")), forum: @forum, permission: i+1)
end
end
if @forum.save if @forum.save
flash[:notice] = "Forum created." flash[:notice] = "Forum created."
redirect_to @forum redirect_to @forum

View File

@@ -137,9 +137,9 @@ class UsersController < ApplicationController
def update def update
if (mod? && current_user.role >= @user.role ) || (@user.is?(current_user) && confirmed?) if (mod? && current_user.role >= @user.role ) || (@user.is?(current_user) && confirmed?)
if mod? if mod?
userdata = user_params([:name, :skype, :skype_public, :youtube, :twitter, :mastodon, :about, :role, :badge, :confirmed, :header_scroll, :utc_time, :dark]) userdata = user_params([:name, :skype, :skype_public, :youtube, :twitter, :about, :role, :badge, :confirmed, :header_scroll, :utc_time, :dark])
else else
userdata = user_params([:name, :skype, :skype_public, :youtube, :twitter, :mastodon, :about, :header_scroll, :utc_time, :dark]) userdata = user_params([:name, :skype, :skype_public, :youtube, :twitter, :about, :header_scroll, :utc_time, :dark])
end end
if userdata[:role] if userdata[:role]
role = Role.get(userdata[:role]) role = Role.get(userdata[:role])

View File

@@ -1,6 +1,7 @@
class Badge < ActiveRecord::Base class Badge < ActiveRecord::Base
include Comparable include Comparable
has_many :users has_many :users
has_and_belongs_to_many :forums
def self.get (input) def self.get (input)
if input.is_a?(String) || input.is_a?(Symbol) if input.is_a?(String) || input.is_a?(Symbol)

View File

@@ -0,0 +1,7 @@
class Badgeassociation < ActiveRecord::Base
belongs_to :badge
belongs_to :forum
belongs_to :forumgroup
end

View File

@@ -1,6 +1,10 @@
class Forum < ActiveRecord::Base class Forum < ActiveRecord::Base
belongs_to :forumgroup belongs_to :forumgroup
has_many :forumthreads has_many :forumthreads
has_many :badgeassociations
has_many :badges, through: :badgeassociations
belongs_to :role_read, class_name: "Role", foreign_key: "role_read_id" belongs_to :role_read, class_name: "Role", foreign_key: "role_read_id"
belongs_to :role_write, class_name: "Role", foreign_key: "role_write_id" belongs_to :role_write, class_name: "Role", foreign_key: "role_write_id"
has_and_belongs_to_many :labels has_and_belongs_to_many :labels
@@ -18,11 +22,11 @@ class Forum < ActiveRecord::Base
end end
def can_read?(user) def can_read?(user)
group && group.can_read?(user) && (role_read.nil? || (!user.nil? && user.role >= role_read)) group && group.can_read?(user) && (role_read.nil? || (!user.nil? && user.role >= role_read) || Badgeassociation.find_by(badge: user.badge, forum: self, permission: 1))
end end
def can_write?(user) def can_write?(user)
group.can_write?(user) && (role_write.nil? || (!user.nil? && user.role >= role_write)) group.can_write?(user) && (role_write.nil? || (!user.nil? && user.role >= role_write || Badgeassociation.find_by(badge: user.badge, forum: self, permission: 2)))
end end
def can_view?(user) def can_view?(user)

View File

@@ -4,7 +4,8 @@ class Forumgroup < ActiveRecord::Base
belongs_to :role_write, class_name: "Role", foreign_key: "role_write_id" belongs_to :role_write, class_name: "Role", foreign_key: "role_write_id"
accepts_nested_attributes_for :forums accepts_nested_attributes_for :forums
has_many :badgeassociations
has_many :badges, through: :badgeassociations
validates_presence_of :name, :position validates_presence_of :name, :position
validates_length_of :name, in: 2..20 validates_length_of :name, in: 2..20
@@ -14,11 +15,11 @@ class Forumgroup < ActiveRecord::Base
end end
def can_read?(user) def can_read?(user)
role_read.nil? || (!user.nil? && user.role >= role_read) role_read.nil? || (!user.nil? && user.role >= role_read) || Badgeassociation.find_by(badge: user.badge, forumgroup: self, permission: 1)
end end
def can_write?(user) def can_write?(user)
!user.nil? && user.confirmed? && (role_write.nil? || user.role >= role_write) !user.nil? && user.confirmed? && (role_write.nil? || user.role >= role_write) || Badgeassociation.find_by(badge: user.badge, forumgroup: self, permission: 2)
end end
def can_view?(user) def can_view?(user)

View File

@@ -86,7 +86,7 @@ class Forumthread < ActiveRecord::Base
.joins("LEFT JOIN roles as forumgroup_role_read ON forumgroups.role_read_id = forumgroup_role_read.id") .joins("LEFT JOIN roles as forumgroup_role_read ON forumgroups.role_read_id = forumgroup_role_read.id")
.joins("LEFT JOIN roles as forumgroup_role_write ON forumgroups.role_write_id = forumgroup_role_write.id") .joins("LEFT JOIN roles as forumgroup_role_write ON forumgroups.role_write_id = forumgroup_role_write.id")
threads = threads.where("forumthreads.user_author_id = ? OR (#{can_read}) OR (#{sticky_can_write})", user_id, role_value, role_value, role_value, role_value) threads = threads.where("forumthreads.user_author_id = ? OR (#{can_read}) OR (#{sticky_can_write}) OR (?)", user_id, role_value, role_value, role_value, role_value, Forum.find(forum).can_read?(user))
if query if query
threads = threads.where("#{match[2]}", query[0..99], query[0..99]) threads = threads.where("#{match[2]}", query[0..99], query[0..99])
elsif [title, content, reply].any? elsif [title, content, reply].any?

View File

@@ -22,8 +22,6 @@ class User < ActiveRecord::Base
validates :email, uniqueness: {case_sensitive: false}, format: {with: /\A.+@(.+\..{2,}|\[(IPv6)?[0-9a-f:.]+\])\z/i, message: "That doesn't look like an email address."} validates :email, uniqueness: {case_sensitive: false}, format: {with: /\A.+@(.+\..{2,}|\[(IPv6)?[0-9a-f:.]+\])\z/i, message: "That doesn't look like an email address."}
validates :ign, uniqueness: {case_sensitive: false}, format: {with: /\A[a-z\d_]+\z/i, message: "Username is invalid (a-z, 0-9, _)."} validates :ign, uniqueness: {case_sensitive: false}, format: {with: /\A[a-z\d_]+\z/i, message: "Username is invalid (a-z, 0-9, _)."}
validates :mastodon, uniqueness: {case_sensitive: false}, format: {with: /\A(.+@(.+\..{2,}|\[(IPv6)?[0-9a-f:.]+\]))?\z/i, message: "That doesn't look like a valid Mastodon handle."}
has_many :blogposts has_many :blogposts
has_many :comments has_many :comments
@@ -169,7 +167,6 @@ class User < ActiveRecord::Base
self.email.strip! if self.email self.email.strip! if self.email
self.about.strip! if self.about self.about.strip! if self.about
self.skype.strip! if self.skype self.skype.strip! if self.skype
self.mastodon.strip! if self.mastodon
self.youtube.strip! if self.youtube self.youtube.strip! if self.youtube
self.twitter.strip! if self.twitter self.twitter.strip! if self.twitter
end end

View File

@@ -29,12 +29,28 @@
<td><%= f.label :role_read_id, "Min. read role" %></td> <td><%= f.label :role_read_id, "Min. read role" %></td>
<td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td> <td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td>
</tr> </tr>
<tr>
<td><b>Badges with read permission</b></td>
<td>
<% Badge.where("name != 'none'").each do |b| %>
<%=b%><%= check_box_tag "read-#{b}", nil, Badgeassociation.find_by(badge: b, forumgroup: @group, permission: 1) %>
<% end %>
</td>
</tr>
<tr> <tr>
<td><%= f.label :role_write_id, "Min. write role" %></td> <td><%= f.label :role_write_id, "Min. write role" %></td>
<td><%= f.select :role_write_id, role_selection, include_blank: false %></td> <td><%= f.select :role_write_id, role_selection, include_blank: false %></td>
</tr> </tr>
<tr>
<td><b>Badges with write permission</b></td>
<td>
<% Badge.where("name != 'none'").each do |b| %>
<%=b%><%= check_box_tag "write-#{b}", nil, Badgeassociation.find_by(badge: b, forumgroup: @group, permission: 2) %>
<% end %>
</td>
</tr>
</table> </table>
<p><%= f.submit "Update group", class: "btn blue left" %></p> <p><%= f.submit "Update group", class: "btn blue left" %></p>
<% end %> <% end %>
<p><%= button_to "Delete group", @group, :method => "delete", data: {confirm: "Delete group?\nForums + Threads will not be accessible!"}, class: "btn red right" %></p> <p><%= button_to "Delete group", @group, :method => "delete", data: {confirm: "Delete group?\nForums + Threads will not be accessible!"}, class: "btn red right" %></p>
<div class="clear"></div> <div class="clear"></div>

View File

@@ -16,11 +16,27 @@
<td><%= f.label :role_read_id, "Min. read role" %></td> <td><%= f.label :role_read_id, "Min. read role" %></td>
<td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td> <td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td>
</tr> </tr>
<tr>
<td><b>Badges with read permission</b></td>
<td>
<% Badge.where("name != 'none'").each do |b| %>
<%=b%><%= check_box_tag "read-#{b}" %>
<% end %>
</td>
</tr>
<tr> <tr>
<td><%= f.label :role_write_id, "Min. write role" %></td> <td><%= f.label :role_write_id, "Min. write role" %></td>
<td><%= f.select :role_write_id, role_selection, include_blank: false %></td> <td><%= f.select :role_write_id, role_selection, include_blank: false %></td>
</tr> </tr>
<tr>
<td><b>Badges with write permission</b></td>
<td>
<% Badge.where("name != 'none'").each do |b| %>
<%=b%><%= check_box_tag "write-#{b}" %>
<% end %>
</td>
</tr>
</table> </table>
<p><%= f.submit "Create group", class: "btn blue left" %></p> <p><%= f.submit "Create group", class: "btn blue left" %></p>
<div class="clear"></div> <div class="clear"></div>
<% end %> <% end %>

View File

@@ -17,10 +17,26 @@
<td><%= f.label :role_read_id, "Min. read role" %></td> <td><%= f.label :role_read_id, "Min. read role" %></td>
<td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td> <td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td>
</tr> </tr>
<tr>
<td><b>Badges with read permission</b></td>
<td>
<% Badge.where("name != 'none'").each do |b| %>
<%=b%><%= check_box_tag "read-#{b}", nil, Badgeassociation.find_by(badge: b, forum: @forum, permission: 1) %>
<% end %>
</td>
</tr>
<tr> <tr>
<td><%= f.label :role_write_id, "Min. write role" %></td> <td><%= f.label :role_write_id, "Min. write role" %></td>
<td><%= f.select :role_write_id, role_selection, include_blank: false %></td> <td><%= f.select :role_write_id, role_selection, include_blank: false %></td>
</tr> </tr>
<tr>
<td><b>Badges with write permission</b></td>
<td>
<% Badge.where("name != 'none'").each do |b| %>
<%=b%><%= check_box_tag "write-#{b}", nil, Badgeassociation.find_by(badge: b, forum: @forum, permission: 2) %>
<% end %>
</td>
</tr>
<tr> <tr>
<td><%= f.label :necro_length, "Necropost warning delay (in days)" %></td> <td><%= f.label :necro_length, "Necropost warning delay (in days)" %></td>
<td><%= f.number_field :necro_length, placeholder: "Warning Delay (leave blank for no warning)" %></td> <td><%= f.number_field :necro_length, placeholder: "Warning Delay (leave blank for no warning)" %></td>

View File

@@ -17,10 +17,26 @@
<td><%= f.label :role_read_id, "Min. read role" %></td> <td><%= f.label :role_read_id, "Min. read role" %></td>
<td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td> <td><%= f.select :role_read_id, role_selection, include_blank: "None" %></td>
</tr> </tr>
<tr>
<td><b>Badges with read permission</b></td>
<td>
<% Badge.where("name != 'none'").each do |b| %>
<%=b%><%= check_box_tag "read-#{b}" %>
<% end %>
</td>
</tr>
<tr> <tr>
<td><%= f.label :role_write_id, "Min. write role" %></td> <td><%= f.label :role_write_id, "Min. write role" %></td>
<td><%= f.select :role_write_id, role_selection, include_blank: false %></td> <td><%= f.select :role_write_id, role_selection, include_blank: false %></td>
</tr> </tr>
<tr>
<td><b>Badges with write permission</b></td>
<td>
<% Badge.where("name != 'none'").each do |b| %>
<%=b%><%= check_box_tag "write-#{b}" %>
<% end %>
</td>
</tr>
<tr> <tr>
<td><%= f.label :necro_length, "Necropost warning delay (in days)" %></td> <td><%= f.label :necro_length, "Necropost warning delay (in days)" %></td>
<td><%= f.number_field :necro_length, placeholder: "Warning Delay (leave blank for no warning)" %></td> <td><%= f.number_field :necro_length, placeholder: "Warning Delay (leave blank for no warning)" %></td>

View File

@@ -54,12 +54,6 @@
<%= f.select :skype_public, [["Staff only", false], ["All users", true]], {}, { disabled: !can_edit? } %> <%= f.select :skype_public, [["Staff only", false], ["All users", true]], {}, { disabled: !can_edit? } %>
</td> </td>
</tr> </tr>
<tr>
<td>Mastodon</td>
<td>
<%= f.text_field :mastodon, placeholder: "Mastodon username", disabled: !(@user.is?(current_user) && confirmed? || (mod? && current_user.role >= @user.role)) %>
</td>
</tr>
<tr> <tr>
<td>YouTube Channel ID</td> <td>YouTube Channel ID</td>
<td> <td>

View File

@@ -58,18 +58,6 @@
<td><%= link_to @user.skype, "skype:#{@user.skype}?chat", target: "_blank" %></a></td> <td><%= link_to @user.skype, "skype:#{@user.skype}?chat", target: "_blank" %></a></td>
</tr> </tr>
<% end %> <% end %>
<% if !@user.mastodon.blank? %>
<tr>
<td><b>Mastodon</b></td>
<td>
<% mstdn_array = @user.mastodon.split("@") %>
<% if mstdn_array.length > 1 %>
<%= link_to "@#{mstdn_array[0]}", "https://#{CGI.escape(mstdn_array[1])}/@#{CGI.escape(mstdn_array[0])}", :target => "_blank" %></td>
<% else %>
<%= "@" + @user.mastodon %>
<% end %>
</tr>
<% end %>
<% if !@user.youtube.blank? && !@user.youtube_channelname.blank? %> <% if !@user.youtube.blank? && !@user.youtube_channelname.blank? %>
<tr> <tr>
<td><b>YouTube</b></td> <td><b>YouTube</b></td>

View File

@@ -1,5 +0,0 @@
class AddMastodonToUsers < ActiveRecord::Migration
def change
add_column :users, :mastodon, :string
end
end

View File

@@ -0,0 +1,10 @@
class CreateBadgeassociations < ActiveRecord::Migration
def change
create_table :badgeassociations do |t|
t.references :badge
t.references :forum
t.references :forumgroup
t.integer :permission #1 = read, 2 = write
end
end
end

View File

@@ -11,17 +11,18 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170707012441) do ActiveRecord::Schema.define(version: 20170703003647) do
create_table "badges", force: :cascade do |t| create_table "badges", force: :cascade do |t|
t.string "name", limit: 191 t.string "name", limit: 191
t.string "symbol", limit: 191 t.string "symbol", limit: 191
t.string "color", limit: 191 t.string "color", limit: 191
t.integer "value", limit: 4
end end
create_table "blogposts", force: :cascade do |t| create_table "blogposts", force: :cascade do |t|
t.string "title", limit: 191 t.string "title", limit: 255
t.text "content", limit: 65535 t.text "content", limit: 16777215
t.integer "user_author_id", limit: 4 t.integer "user_author_id", limit: 4
t.integer "user_editor_id", limit: 4 t.integer "user_editor_id", limit: 4
t.datetime "created_at" t.datetime "created_at"
@@ -29,7 +30,7 @@ ActiveRecord::Schema.define(version: 20170707012441) do
end end
create_table "comments", force: :cascade do |t| create_table "comments", force: :cascade do |t|
t.text "content", limit: 65535 t.text "content", limit: 16777215
t.integer "user_author_id", limit: 4 t.integer "user_author_id", limit: 4
t.integer "user_editor_id", limit: 4 t.integer "user_editor_id", limit: 4
t.integer "blogpost_id", limit: 4 t.integer "blogpost_id", limit: 4
@@ -38,14 +39,14 @@ ActiveRecord::Schema.define(version: 20170707012441) do
end end
create_table "forumgroups", force: :cascade do |t| create_table "forumgroups", force: :cascade do |t|
t.string "name", limit: 191 t.string "name", limit: 255
t.integer "position", limit: 4 t.integer "position", limit: 4
t.integer "role_read_id", limit: 4 t.integer "role_read_id", limit: 4
t.integer "role_write_id", limit: 4 t.integer "role_write_id", limit: 4
end end
create_table "forums", force: :cascade do |t| create_table "forums", force: :cascade do |t|
t.string "name", limit: 191 t.string "name", limit: 255
t.integer "position", limit: 4 t.integer "position", limit: 4
t.integer "role_read_id", limit: 4 t.integer "role_read_id", limit: 4
t.integer "role_write_id", limit: 4 t.integer "role_write_id", limit: 4
@@ -59,10 +60,10 @@ ActiveRecord::Schema.define(version: 20170707012441) do
end end
create_table "forumthreads", force: :cascade do |t| create_table "forumthreads", force: :cascade do |t|
t.string "title", limit: 191 t.string "title", limit: 255
t.text "content", limit: 65535 t.text "content", limit: 16777215
t.boolean "sticky", default: false t.boolean "sticky", default: false
t.boolean "locked", default: false t.boolean "locked", default: false
t.integer "user_author_id", limit: 4 t.integer "user_author_id", limit: 4
t.integer "user_editor_id", limit: 4 t.integer "user_editor_id", limit: 4
t.integer "forum_id", limit: 4 t.integer "forum_id", limit: 4
@@ -72,47 +73,49 @@ ActiveRecord::Schema.define(version: 20170707012441) do
end end
add_index "forumthreads", ["content"], name: "index_forumthreads_on_content", type: :fulltext add_index "forumthreads", ["content"], name: "index_forumthreads_on_content", type: :fulltext
add_index "forumthreads", ["title", "content"], name: "forumthreads_title_content", type: :fulltext
add_index "forumthreads", ["title", "content"], name: "index_forumthreads_on_title_and_content", type: :fulltext add_index "forumthreads", ["title", "content"], name: "index_forumthreads_on_title_and_content", type: :fulltext
add_index "forumthreads", ["title"], name: "index_forumthreads_on_title", type: :fulltext add_index "forumthreads", ["title"], name: "index_forumthreads_on_title", type: :fulltext
create_table "info", force: :cascade do |t| create_table "info", force: :cascade do |t|
t.string "title", limit: 191 t.string "title", limit: 255
t.text "content", limit: 65535 t.text "content", limit: 16777215
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
end end
create_table "labels", force: :cascade do |t| create_table "labels", force: :cascade do |t|
t.string "name", limit: 191 t.string "name", limit: 255
t.string "color", limit: 191 t.string "color", limit: 255
end end
create_table "register_tokens", force: :cascade do |t| create_table "register_tokens", force: :cascade do |t|
t.string "uuid", limit: 32, null: false t.string "uuid", limit: 32, null: false
t.string "token", limit: 6, null: false t.string "token", limit: 6, null: false
t.string "email", limit: 191, null: false t.string "email", limit: 191
end end
add_index "register_tokens", ["email"], name: "index_register_tokens_on_email", unique: true, using: :btree
add_index "register_tokens", ["uuid"], name: "index_register_tokens_on_uuid", unique: true, using: :btree add_index "register_tokens", ["uuid"], name: "index_register_tokens_on_uuid", unique: true, using: :btree
create_table "roles", force: :cascade do |t| create_table "roles", force: :cascade do |t|
t.string "name", limit: 191 t.string "name", limit: 255
t.integer "value", limit: 4 t.integer "value", limit: 4
t.string "color", limit: 191 t.string "color", limit: 255
end end
create_table "sessions", force: :cascade do |t| create_table "sessions", force: :cascade do |t|
t.string "session_id", limit: 191, null: false t.string "session_id", limit: 255, null: false
t.text "data", limit: 65535 t.text "data", limit: 16777215
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
end end
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", length: {"session_id"=>191}, using: :btree
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
create_table "threadreplies", force: :cascade do |t| create_table "threadreplies", force: :cascade do |t|
t.text "content", limit: 65535 t.text "content", limit: 16777215
t.integer "user_author_id", limit: 4 t.integer "user_author_id", limit: 4
t.integer "user_editor_id", limit: 4 t.integer "user_editor_id", limit: 4
t.integer "forumthread_id", limit: 4 t.integer "forumthread_id", limit: 4
@@ -124,19 +127,19 @@ ActiveRecord::Schema.define(version: 20170707012441) do
add_index "threadreplies", ["forumthread_id"], name: "index_threadreplies_on_forumthread_id", using: :btree add_index "threadreplies", ["forumthread_id"], name: "index_threadreplies_on_forumthread_id", using: :btree
create_table "users", force: :cascade do |t| create_table "users", force: :cascade do |t|
t.string "uuid", limit: 191, null: false t.string "uuid", limit: 255, null: false
t.string "name", limit: 191 t.string "name", limit: 191
t.string "password_digest", limit: 191, null: false t.string "password_digest", limit: 255, null: false
t.string "ign", limit: 191, null: false t.string "ign", limit: 255, null: false
t.string "email", limit: 191, null: false t.string "email", limit: 191
t.text "about", limit: 65535 t.text "about", limit: 65535
t.string "last_ip", limit: 191 t.string "last_ip", limit: 255
t.string "skype", limit: 191 t.string "skype", limit: 255
t.boolean "skype_public", default: false t.boolean "skype_public", default: false
t.string "youtube", limit: 191 t.string "youtube", limit: 255
t.string "youtube_channelname", limit: 191 t.string "youtube_channelname", limit: 255
t.string "twitter", limit: 191 t.string "twitter", limit: 255
t.string "email_token", limit: 191 t.string "email_token", limit: 255
t.boolean "confirmed", default: false t.boolean "confirmed", default: false
t.datetime "last_seen" t.datetime "last_seen"
t.integer "role_id", limit: 4, null: false t.integer "role_id", limit: 4, null: false
@@ -147,11 +150,10 @@ ActiveRecord::Schema.define(version: 20170707012441) do
t.boolean "mail_own_blogpost_comment", default: true t.boolean "mail_own_blogpost_comment", default: true
t.boolean "mail_other_blogpost_comment", default: true t.boolean "mail_other_blogpost_comment", default: true
t.boolean "mail_mention", default: true t.boolean "mail_mention", default: true
t.integer "badge_id", limit: 4, default: 1 t.integer "badge_id", limit: 4, default: 0
t.boolean "utc_time", default: false t.boolean "utc_time", default: false
t.boolean "header_scroll", default: false t.boolean "header_scroll", default: false
t.boolean "dark", default: false t.boolean "dark", default: false
t.string "mastodon", limit: 191
end end
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree