Sha256: ed2603acb246bb4bb1e88eb0bf028a376bac850de8b63089e7295a0a99d5d7f4
Contents?: true
Size: 537 Bytes
Versions: 14
Compression:
Stored size: 537 Bytes
Contents
class CreateProclaimSubscriptions < ActiveRecord::Migration def change create_table :proclaim_subscriptions do |t| t.belongs_to :post, index: true t.string :email t.timestamps null: false end add_foreign_key :proclaim_subscriptions, :proclaim_posts, column: :post_id # This ensures that even if two clients try to create the same # subscription at exactly the same time, the database won't accept # one of them (Rails would have) add_index :proclaim_subscriptions, [:post_id, :email], :unique => true end end
Version data entries
14 entries across 14 versions & 1 rubygems