Sha256: 7a47e72b3faa3ec3cac5e8ae4345ab44914ba180b8de2859f63551482dbd1f59

Contents?: true

Size: 699 Bytes

Versions: 13

Compression:

Stored size: 699 Bytes

Contents

# frozen_string_literal: true

class CreateActiveRecallTables < ActiveRecord::Migration[5.2]
  def self.up
    create_table :active_recall_decks do |t|
      t.references :user, polymorphic: true
      t.timestamps
    end
    add_index :active_recall_decks, %i[user_id user_type]

    create_table :active_recall_items do |t|
      t.references  :deck
      t.references  :source, polymorphic: true
      t.integer     :box, default: 0
      t.timestamp   :last_reviewed
      t.timestamp   :next_review
      t.timestamps
    end
    add_index :active_recall_items, %i[source_id source_type]
  end

  def self.down
    drop_table :active_recall_decks
    drop_table :active_recall_items
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active_recall-1.6.4 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.6.3 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.6.2 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.6.1 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.6.0 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.5.0 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.4.0 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.3.0 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.2.2 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.2.1 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.2.0 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.1.0 lib/generators/active_recall/templates/create_active_recall_tables.rb
active_recall-1.0.0 lib/generators/active_recall/templates/create_active_recall_tables.rb