Skip to content

Commit

Permalink
Adds missing translations from alchemy engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas von Deyen committed Nov 19, 2014
1 parent 299f9f6 commit a2b1c30
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This migration comes from alchemy (originally 20130918201742)
class AddPublishedAtToAlchemyPages < ActiveRecord::Migration
def change
add_column :alchemy_pages, :published_at, :timestamp
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This migration comes from alchemy (originally 20140107192720)
class AddMissingUniqueIndicesToTagsAndTaggings < ActiveRecord::Migration

def self.up
add_index :tags, :name, unique: true

remove_index :taggings, :tag_id
remove_index :taggings, [:taggable_id, :taggable_type, :context]
add_index :taggings,
[:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type],
unique: true, name: 'taggings_idx'
end

def self.down
remove_index :tags, :name

remove_index :taggings, name: 'tagging_idx'
add_index :taggings, :tag_id
add_index :taggings, [:taggable_id, :taggable_type, :context]
end

end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This migration comes from alchemy (originally 20140701160159)
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
def self.up
add_column :tags, :taggings_count, :integer, default: 0

ActsAsTaggableOn::Tag.reset_column_information
ActsAsTaggableOn::Tag.find_each do |tag|
ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings)
end
end

def self.down
remove_column :tags, :taggings_count
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This migration comes from alchemy (originally 20140701160225)
class AddMissingTaggableIndex < ActiveRecord::Migration
def self.up
add_index :taggings, [:taggable_id, :taggable_type, :context]
end

def self.down
remove_index :taggings, [:taggable_id, :taggable_type, :context]
end
end
10 changes: 7 additions & 3 deletions spec/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20131225232042) do
ActiveRecord::Schema.define(version: 20141119205158) do

create_table "alchemy_attachments", force: true do |t|
t.string "name"
Expand Down Expand Up @@ -232,6 +232,7 @@
t.integer "updater_id"
t.integer "language_id"
t.text "cached_tag_list"
t.datetime "published_at"
end

add_index "alchemy_pages", ["language_id"], name: "index_pages_on_language_id"
Expand Down Expand Up @@ -326,11 +327,14 @@
t.datetime "created_at"
end

add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id"
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: true do |t|
t.string "name"
t.string "name"
t.integer "taggings_count", default: 0
end

add_index "tags", ["name"], name: "index_tags_on_name", unique: true

end

0 comments on commit a2b1c30

Please sign in to comment.