Sha256: 7ca58f58f92eea6ad81912b6915b91f06775ed3e2267d52fe38beb8a4b278b7e
Contents?: true
Size: 1.25 KB
Versions: 4
Compression:
Stored size: 1.25 KB
Contents
### # CreateFollows class # # This class defines the create follows migration in follow system ### class CreateFollows < ActiveRecord::Migration ### # Changes the database ### def change ### # Follows table creation ### create_table :follows do |t| ### # Followee id field and followee type field definition ### t.references :followee, polymorphic: true ### # Follower id fiel and follower type field definition ### t.references :follower, polymorphic: true ### # Timestamps fields definition ### t.timestamps null: false end ### # Follows table followee id field and followee type field index addition ### add_index :follows, [:followee_id, :followee_type], name: "follows_followee_idx" ### # Follows table follower id field and follower type field index addition ### add_index :follows, [:follower_id, :follower_type], name: "follows_follower_idx" ### # Follows table followee id field and followee type field and follower id field and follower type field unique index addition ### add_index :follows, [:followee_id, :followee_type, :follower_id, :follower_type], name: "follows_followee_follower_idx", unique: true end end
Version data entries
4 entries across 4 versions & 1 rubygems