From 507ae450d146511f48518a4e1a08dff111501d22 Mon Sep 17 00:00:00 2001 From: echarp Date: Mon, 4 Jan 2016 00:54:32 +0100 Subject: [PATCH] Quick correction on migration to add tags to organisations --- config/database.yml | 5 +- db/migrate/20160103141244_add_tags_to_orga.rb | 2 +- db/schema.rb | 75 +++++++------------ 3 files changed, 31 insertions(+), 51 deletions(-) diff --git a/config/database.yml b/config/database.yml index beb7f232..f663b585 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,4 +1,4 @@ -development: +evelopment: adapter: sqlite3 pool: 5 timeout: 5000 @@ -13,7 +13,8 @@ test: timeout: 5000 database: db/test.sqlite3 -production: +roduction: +development: adapter: mysql2 encoding: utf8 database: adl_fr diff --git a/db/migrate/20160103141244_add_tags_to_orga.rb b/db/migrate/20160103141244_add_tags_to_orga.rb index 1cf7f93a..d722558e 100644 --- a/db/migrate/20160103141244_add_tags_to_orga.rb +++ b/db/migrate/20160103141244_add_tags_to_orga.rb @@ -1,6 +1,6 @@ # Adding keywords to organisations class AddTagsToOrga < ActiveRecord::Migration def change - add_column :orgas, :tags, :text, null: true, default: '' + add_column :orgas, :tags, :string, null: true, default: '' end end diff --git a/db/schema.rb b/db/schema.rb index 67b32f87..cd099d12 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -24,9 +24,9 @@ ActiveRecord::Schema.define(version: 20160103141244) do t.datetime "updated_at" end - add_index "active_admin_comments", ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id" - add_index "active_admin_comments", ["namespace"], name: "index_active_admin_comments_on_namespace" - add_index "active_admin_comments", ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id" + add_index "active_admin_comments", ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id", using: :btree + add_index "active_admin_comments", ["namespace"], name: "index_active_admin_comments_on_namespace", using: :btree + add_index "active_admin_comments", ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id", using: :btree create_table "admin_users", force: :cascade do |t| t.string "email", limit: 255, default: "", null: false @@ -43,8 +43,8 @@ ActiveRecord::Schema.define(version: 20160103141244) do t.datetime "updated_at" end - add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true - add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true + add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true, using: :btree + add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true, using: :btree create_table "cities", force: :cascade do |t| t.string "name", limit: 255, default: "", null: false @@ -56,7 +56,7 @@ ActiveRecord::Schema.define(version: 20160103141244) do t.float "longitude", limit: 24 end - add_index "cities", ["name"], name: "cities_name" + add_index "cities", ["name"], name: "cities_name", using: :btree create_table "events", force: :cascade do |t| t.string "title", limit: 255, default: "", null: false @@ -72,8 +72,8 @@ ActiveRecord::Schema.define(version: 20160103141244) do t.integer "moderated", limit: 4, default: 0, null: false t.string "tags", limit: 255, default: "", null: false t.string "secret", limit: 255, default: "", null: false - t.datetime "decision_time" - t.datetime "submission_time" + t.datetime "decision_time", null: false + t.datetime "submission_time", null: false t.string "moderator_mail_id", limit: 32 t.string "submitter_mail_id", limit: 32 t.text "address", limit: 65535 @@ -83,7 +83,7 @@ ActiveRecord::Schema.define(version: 20160103141244) do t.string "place_name", limit: 255 end - add_index "events", ["start_time", "end_time"], name: "events_date" + add_index "events", ["start_time", "end_time"], name: "events_date", using: :btree create_table "kinds", force: :cascade do |t| t.string "name", limit: 255, null: false @@ -100,60 +100,39 @@ ActiveRecord::Schema.define(version: 20160103141244) do end create_table "orgas", force: :cascade do |t| - t.integer "region_id", limit: 4, default: 0, null: false - t.string "department", limit: 4, default: "0", null: false - t.string "name", limit: 255, default: "", null: false - t.string "url", limit: 255, default: "", null: false - t.string "city", limit: 255, default: "", null: false + t.integer "region_id", limit: 4, default: 0, null: false + t.string "department", limit: 255 + t.string "name", limit: 255, default: "", null: false + t.string "url", limit: 255, default: "", null: false + t.string "city", limit: 255, default: "", null: false t.integer "kind_id", limit: 4 t.string "feed", limit: 255 t.string "contact", limit: 255 t.string "submitter", limit: 255 - t.boolean "moderated", limit: 1, default: false + t.boolean "moderated", default: false t.datetime "submission_time" t.datetime "decision_time" t.string "secret", limit: 255 - t.boolean "deleted", limit: 1, default: false, null: false - t.boolean "active", default: true, null: false - t.text "description" + t.boolean "deleted", default: false, null: false + t.boolean "active", default: true, null: false + t.text "description", limit: 65535 t.datetime "created_at" t.datetime "updated_at" - t.text "tag" - t.text "tags", default: "" + t.string "tags", limit: 255, default: "" end - add_index "orgas", ["kind_id"], name: "index_orgas_on_kind_id" + add_index "orgas", ["kind_id"], name: "index_orgas_on_kind_id", using: :btree create_table "regions", force: :cascade do |t| t.string "name", limit: 255, default: "", null: false end - create_table "taggings", force: :cascade do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type", limit: 255 - t.integer "tagger_id" - t.string "tagger_type", limit: 255 - t.string "context", limit: 128 - t.datetime "created_at" - end - - add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true - add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context" - - create_table "tags", force: :cascade do |t| - t.string "name", limit: 255 - t.integer "taggings_count", default: 0 - end - - add_index "tags", ["name"], name: "index_tags_on_name", unique: true - create_table "translations", force: :cascade do |t| t.string "locale", limit: 255 t.string "key", limit: 255 t.text "value", limit: 65535 t.text "interpolations", limit: 65535 - t.boolean "is_proc", limit: 1, default: false + t.boolean "is_proc", default: false end create_table "users", force: :cascade do |t| @@ -165,14 +144,14 @@ ActiveRecord::Schema.define(version: 20160103141244) do end create_table "versions", force: :cascade do |t| - t.string "item_type", null: false - t.integer "item_id", null: false - t.string "event", null: false - t.string "whodunnit" - t.text "object" + t.string "item_type", limit: 255, null: false + t.integer "item_id", limit: 4, null: false + t.string "event", limit: 255, null: false + t.string "whodunnit", limit: 255 + t.text "object", limit: 65535 t.datetime "created_at" end - add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id" + add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id", using: :btree end