|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +class CreateSpreeUsers < ActiveRecord::Migration[7.0] |
| 4 | + def change |
| 5 | + create_table :spree_users, if_not_exists: true do |t| |
| 6 | + t.string :login |
| 7 | + t.string :email |
| 8 | + t.string :unconfirmed_email |
| 9 | + |
| 10 | + t.string :encrypted_password, limit: 128 |
| 11 | + t.string :password_salt, limit: 128 |
| 12 | + t.string :reset_password_token |
| 13 | + t.string :spree_api_key, limit: 48 |
| 14 | + |
| 15 | + t.string :confirmation_token |
| 16 | + t.string :perishable_token |
| 17 | + t.string :persistence_token |
| 18 | + t.string :remember_token |
| 19 | + t.string :unlock_token |
| 20 | + |
| 21 | + t.integer :sign_in_count, default: 0, null: false |
| 22 | + t.integer :failed_attempts, default: 0, null: false |
| 23 | + |
| 24 | + t.string :current_sign_in_ip |
| 25 | + t.string :last_sign_in_ip |
| 26 | + |
| 27 | + t.references :ship_address, foreign_key: {to_table: :spree_addresses} |
| 28 | + t.references :bill_address, foreign_key: {to_table: :spree_addresses} |
| 29 | + |
| 30 | + t.datetime :confirmation_sent_at |
| 31 | + t.datetime :confirmed_at |
| 32 | + t.datetime :current_sign_in_at |
| 33 | + t.datetime :deleted_at |
| 34 | + t.datetime :last_request_at |
| 35 | + t.datetime :last_sign_in_at |
| 36 | + t.datetime :locked_at |
| 37 | + t.datetime :remember_created_at |
| 38 | + t.datetime :reset_password_sent_at |
| 39 | + |
| 40 | + t.timestamps null: false |
| 41 | + |
| 42 | + t.index :deleted_at, name: "index_spree_users_on_deleted_at" |
| 43 | + t.index :email, name: "email_idx_unique", unique: true |
| 44 | + t.index :reset_password_token, name: "index_spree_users_on_reset_password_token_solidus_auth_devise", unique: true |
| 45 | + t.index :spree_api_key, name: "index_spree_users_on_spree_api_key" |
| 46 | + end |
| 47 | + end |
| 48 | +end |
0 commit comments