Sha256: e1c5e17dae82cc000c9e4be43afe4e97b095aed83ce9f5fcec3c5e46461ebabe

Contents?: true

Size: 739 Bytes

Versions: 1

Compression:

Stored size: 739 Bytes

Contents

class <%= migration_name %> < ActiveRecord::Migration<%= migration_version %>

  def change
    create_table :snapshots<%= table_options %> do |t|
      t.belongs_to :item, polymorphic: true, null: false, index: true
      t.string :identifier, null: false, unique: true, index: true
      t.belongs_to :user, polymorphic: true
      t.json :metadata
      t.datetime :created_at, null: false
    end

    create_table :snapshot_items<%= table_options %> do |t|
      t.belongs_to :snapshot, null: false, index: true
      t.belongs_to :item, polymorphic: true, null: false, unique: [:snapshot_id], index: true
      t.json :object, null: false
      t.datetime :created_at, null: false
      t.string :child_group_name
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_snapshot-0.1.0 lib/generators/active_snapshot/install/templates/create_snapshots_tables.rb.erb