Sets the max length of tags to 40 chars in the db

This commit is contained in:
kikito
2015-09-09 17:36:21 +02:00
parent 7157d056af
commit 0e96c82faa
2 changed files with 9 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
class SetTagNameLimit < ActiveRecord::Migration
def change
change_column :tags, :name, :string, limit: 40
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150909142534) do
ActiveRecord::Schema.define(version: 20150909153455) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -193,9 +193,9 @@ ActiveRecord::Schema.define(version: 20150909142534) do
add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
create_table "tags", force: :cascade do |t|
t.string "name"
t.integer "taggings_count", default: 0
t.boolean "featured", default: false
t.string "name", limit: 40
t.integer "taggings_count", default: 0
t.boolean "featured", default: false
end
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree