Sha256: f1005df5c1e588fec9124d5485ab0b3d9d77461563fed891f11533eb4daed198

Contents?: true

Size: 831 Bytes

Versions: 25

Compression:

Stored size: 831 Bytes

Contents

# frozen_string_literal: true
# This migration comes from spree (originally 20160420044191)

class CreateSpreeWalletPaymentSources < ActiveRecord::Migration[4.2]
  def change
    return if table_exists?(:spree_wallet_payment_sources)

    create_table :spree_wallet_payment_sources do |t|
      t.references(
        :user,
        foreign_key: { to_table: Spree.user_class.table_name },
        index: true,
        null: false,
      )
      t.references :payment_source, polymorphic: true, null: false
      t.boolean :default, default: false, null: false

      t.timestamps null: false, precision: 6
    end

    add_index(
      :spree_wallet_payment_sources,
      [:user_id, :payment_source_id, :payment_source_type],
      unique: true,
      name: 'index_spree_wallet_payment_sources_on_source_and_user',
    )
  end
end

Version data entries

25 entries across 25 versions & 9 rubygems

Version Path
solidus_i18n-2.2.0 spec/dummy/db/migrate/20210218213821_create_spree_wallet_payment_sources.spree.rb
solidus_i18n-2.1.1 spec/dummy/db/migrate/20210218213821_create_spree_wallet_payment_sources.spree.rb
solidus_auth_devise-2.5.4 spec/dummy/db/migrate/20211112052441_create_spree_wallet_payment_sources.spree.rb
solidus_reports-1.0.0 spec/dummy/db/migrate/20211108200410_create_spree_wallet_payment_sources.spree.rb
solidus_i18n-2.1.0 spec/dummy/db/migrate/20210218213821_create_spree_wallet_payment_sources.spree.rb
solidus_auth_devise-2.5.3 spec/dummy/db/migrate/20210129115353_create_spree_wallet_payment_sources.spree.rb
solidus_auth_devise-2.5.2 spec/dummy/db/migrate/20201006131544_create_spree_wallet_payment_sources.spree.rb
solidus_auth_devise-2.5.1 spec/dummy/db/migrate/20201006131544_create_spree_wallet_payment_sources.spree.rb
solidus_auth_devise-2.5.0 spec/dummy/db/migrate/20201006131544_create_spree_wallet_payment_sources.spree.rb
solidus_reviews-1.4.1 spec/dummy/db/migrate/20200810122110_create_spree_wallet_payment_sources.spree.rb
solidus_billing_address-0.0.7 spec/dummy/db/migrate/20191128105343_create_spree_wallet_payment_sources.spree.rb
solidus_billing_address-0.0.6 spec/dummy/db/migrate/20191122155242_create_spree_wallet_payment_sources.spree.rb
solidus_drip-0.1.0 spec/dummy/db/migrate/20191101230309_create_spree_wallet_payment_sources.spree.rb
solidus_drip-0.0.1 spec/dummy/db/migrate/20191101230309_create_spree_wallet_payment_sources.spree.rb
solidus_billing_address-0.0.5 spec/dummy/db/migrate/20191028084755_create_spree_wallet_payment_sources.spree.rb
solidus_billing_address-0.0.4 spec/dummy/db/migrate/20190926134946_create_spree_wallet_payment_sources.spree.rb
solidus_billing_address-0.0.3 spec/dummy/db/migrate/20190924075640_create_spree_wallet_payment_sources.spree.rb
solidus_billing_address-0.0.2 spec/dummy/db/migrate/20190920154630_create_spree_wallet_payment_sources.spree.rb
solidus_billing_address-0.0.1 spec/dummy/db/migrate/20190823131006_create_spree_wallet_payment_sources.spree.rb
solidus_bank_transfer-0.1.0 spec/dummy/db/migrate/20190822093440_create_spree_wallet_payment_sources.spree.rb