Sha256: d4470e42a8e42e5d6bfcd612e608019c46752c9c264f70150c99746ec51e06f0
Contents?: true
Size: 903 Bytes
Versions: 16
Compression:
Stored size: 903 Bytes
Contents
# frozen_string_literal: true superclass = ActiveRecord::VERSION::MAJOR < 5 ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] class GutentagTables < superclass def up create_table :gutentag_taggings do |t| t.integer :tag_id, :null => false t.integer :taggable_id, :null => false t.string :taggable_type, :null => false t.timestamps :null => false end add_index :gutentag_taggings, :tag_id add_index :gutentag_taggings, %i[ taggable_type taggable_id ] add_index :gutentag_taggings, %i[ taggable_type taggable_id tag_id ], :unique => true, :name => "unique_taggings" create_table :gutentag_tags do |t| t.string :name, :null => false t.timestamps :null => false end add_index :gutentag_tags, :name, :unique => true end def down drop_table :gutentag_tags drop_table :gutentag_taggings end end
Version data entries
16 entries across 16 versions & 1 rubygems