adding slugs to schools and categories

This commit is contained in:
Jared Cosulich 2017-03-16 16:09:54 -04:00
parent 683fc31c5d
commit 1db61cd3e5
13 changed files with 42 additions and 12 deletions

View file

@ -0,0 +1,6 @@
class AddSlugToSchool < ActiveRecord::Migration[5.0]
def change
add_column :schools, :slug, :string
add_index :schools, :slug, unique: true
end
end

View file

@ -0,0 +1,6 @@
class AddSlugToCategory < ActiveRecord::Migration[5.0]
def change
add_column :categories, :slug, :string
add_index :categories, :slug, unique: true
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170316154053) do
ActiveRecord::Schema.define(version: 20170316194122) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -40,6 +40,8 @@ ActiveRecord::Schema.define(version: 20170316154053) do
t.integer "parent_category_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "slug"
t.index ["slug"], name: "index_categories_on_slug", unique: true, using: :btree
end
create_table "districts", force: :cascade do |t|
@ -141,6 +143,8 @@ ActiveRecord::Schema.define(version: 20170316154053) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "description"
t.string "slug"
t.index ["slug"], name: "index_schools_on_slug", unique: true, using: :btree
end
create_table "users", force: :cascade do |t|