From 0e96c82faa847bfe67a4b1880e9f883ec0cdc1e1 Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 9 Sep 2015 17:36:21 +0200 Subject: [PATCH] Sets the max length of tags to 40 chars in the db --- db/migrate/20150909153455_set_tag_name_limit.rb | 5 +++++ db/schema.rb | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20150909153455_set_tag_name_limit.rb diff --git a/db/migrate/20150909153455_set_tag_name_limit.rb b/db/migrate/20150909153455_set_tag_name_limit.rb new file mode 100644 index 000000000..d4e43dcb8 --- /dev/null +++ b/db/migrate/20150909153455_set_tag_name_limit.rb @@ -0,0 +1,5 @@ +class SetTagNameLimit < ActiveRecord::Migration + def change + change_column :tags, :name, :string, limit: 40 + end +end diff --git a/db/schema.rb b/db/schema.rb index dd20a6347..b23ad3c05 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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