Sha256: 27453b727ce18a08006a0fbce85f7f7f33f11628379ac8cb46faff69ee068771

Contents?: true

Size: 684 Bytes

Versions: 6

Compression:

Stored size: 684 Bytes

Contents

class CreateSnapshotsTables < ActiveRecord::Migration::Current

  def change
    create_table :snapshots 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.text :metadata
      t.datetime :created_at, null: false
    end

    create_table :snapshot_items do |t|
      t.belongs_to :snapshot, null: false, index: true
      t.belongs_to :item, polymorphic: true, null: false, unique: [:snapshot_id], index: true
      t.text :object, null: false
      t.datetime :created_at, null: false
      t.string :child_group_name
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_snapshot-0.2.4 test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb
active_snapshot-0.2.3 test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb
active_snapshot-0.2.2 test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb
active_snapshot-0.2.1 test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb
active_snapshot-0.2.0 test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb
active_snapshot-0.1.1 test/dummy_app/db/migrate/20210306100122_create_snapshots_tables.rb