add new files
This commit is contained in:
20
db/migrate/20170119083734_create_batches.rb
Normal file
20
db/migrate/20170119083734_create_batches.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class CreateBatches < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :batches do |t|
|
||||
t.datetime :date,:null => false
|
||||
t.references :user
|
||||
t.string :order_ref,:null => false
|
||||
t.boolean :batch_start
|
||||
t.boolean :batch_end
|
||||
t.string :created_by,:null => false
|
||||
t.integer :qty_processing,:null => false
|
||||
t.integer :qty_success, :null => false
|
||||
t.integer :qty_fail,:null => false
|
||||
t.datetime :batch_start_time
|
||||
t.datetime :batch_end_time
|
||||
t.integer :export_count
|
||||
t.string :remark
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
47
db/migrate/20170119091253_devise_create_members.rb
Normal file
47
db/migrate/20170119091253_devise_create_members.rb
Normal file
@@ -0,0 +1,47 @@
|
||||
class DeviseCreateMembers < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :members do |t|
|
||||
## Database authenticatable
|
||||
t.references :user
|
||||
t.string :email, null: false, default: ""
|
||||
t.string :encrypted_password, null: false, default: ""
|
||||
|
||||
## Recoverable
|
||||
t.string :reset_password_token
|
||||
t.datetime :reset_password_sent_at
|
||||
|
||||
## Rememberable
|
||||
t.datetime :remember_created_at
|
||||
|
||||
## Trackable
|
||||
t.integer :sign_in_count, default: 0, null: false
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.inet :current_sign_in_ip
|
||||
t.inet :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
t.string :confirmation_token
|
||||
t.datetime :confirmed_at
|
||||
t.datetime :confirmation_sent_at
|
||||
t.string :unconfirmed_email # Only if using reconfirmable
|
||||
|
||||
## Lockable
|
||||
t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
||||
t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
t.datetime :locked_at
|
||||
|
||||
|
||||
t.timestamps null: false
|
||||
## UID
|
||||
t.string :uid
|
||||
t.string :session_token
|
||||
end
|
||||
|
||||
add_index :members, :email, unique: true
|
||||
add_index :members, :reset_password_token, unique: true
|
||||
add_index :members, :confirmation_token, unique: true
|
||||
add_index :members, :unlock_token, unique: true
|
||||
add_index :members, :uid, :unique => true
|
||||
end
|
||||
end
|
||||
12
db/migrate/20170121053223_create_batch_line_items.rb
Normal file
12
db/migrate/20170121053223_create_batch_line_items.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateBatchLineItems < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :batch_line_items do |t|
|
||||
t.references :batch
|
||||
t.string :serial_no , null: false
|
||||
t.string :wristband_code , null: false
|
||||
t.string :manufacture_uid ,null:false
|
||||
t.string :card_type,:default => "child"
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/migrate/20170121083753_create_user.rb
Normal file
14
db/migrate/20170121083753_create_user.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateUser < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :users do |t|
|
||||
t.string :name,:null => false
|
||||
t.string :nrc
|
||||
t.string :email
|
||||
t.boolean :is_active,:default =>false
|
||||
t.string :phone
|
||||
t.string :address
|
||||
t.string :secrect_key
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20170121092515_create_lookups.rb
Normal file
11
db/migrate/20170121092515_create_lookups.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateLookups < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :lookups do |t|
|
||||
t.string :name,:null => false
|
||||
t.integer :max_value
|
||||
t.string :prefix
|
||||
t.integer :max_length
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
100
db/schema.rb
Normal file
100
db/schema.rb
Normal file
@@ -0,0 +1,100 @@
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# Note that this schema.rb definition is the authoritative source for your
|
||||
# database schema. If you need to create the application database on another
|
||||
# system, you should be using db:schema:load, not running all the migrations
|
||||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170121092515) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "batch_line_items", force: :cascade do |t|
|
||||
t.integer "batch_id"
|
||||
t.string "serial_no", null: false
|
||||
t.string "wristband_code", null: false
|
||||
t.string "manufacture_uid", null: false
|
||||
t.string "card_type", default: "child"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["batch_id"], name: "index_batch_line_items_on_batch_id", using: :btree
|
||||
end
|
||||
|
||||
create_table "batches", force: :cascade do |t|
|
||||
t.datetime "date", null: false
|
||||
t.integer "user_id"
|
||||
t.string "order_ref", null: false
|
||||
t.boolean "batch_start"
|
||||
t.boolean "batch_end"
|
||||
t.string "created_by", null: false
|
||||
t.integer "qty_processing", null: false
|
||||
t.integer "qty_success", null: false
|
||||
t.integer "qty_fail", null: false
|
||||
t.datetime "batch_start_time"
|
||||
t.datetime "batch_end_time"
|
||||
t.integer "export_count"
|
||||
t.string "remark"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["user_id"], name: "index_batches_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
create_table "lookups", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.integer "max_value"
|
||||
t.string "prefix"
|
||||
t.integer "max_length"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "members", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.string "email", default: "", null: false
|
||||
t.string "encrypted_password", default: "", null: false
|
||||
t.string "reset_password_token"
|
||||
t.datetime "reset_password_sent_at"
|
||||
t.datetime "remember_created_at"
|
||||
t.integer "sign_in_count", default: 0, null: false
|
||||
t.datetime "current_sign_in_at"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.inet "current_sign_in_ip"
|
||||
t.inet "last_sign_in_ip"
|
||||
t.string "confirmation_token"
|
||||
t.datetime "confirmed_at"
|
||||
t.datetime "confirmation_sent_at"
|
||||
t.string "unconfirmed_email"
|
||||
t.integer "failed_attempts", default: 0, null: false
|
||||
t.string "unlock_token"
|
||||
t.datetime "locked_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "uid"
|
||||
t.string "session_token"
|
||||
t.index ["confirmation_token"], name: "index_members_on_confirmation_token", unique: true, using: :btree
|
||||
t.index ["email"], name: "index_members_on_email", unique: true, using: :btree
|
||||
t.index ["reset_password_token"], name: "index_members_on_reset_password_token", unique: true, using: :btree
|
||||
t.index ["uid"], name: "index_members_on_uid", unique: true, using: :btree
|
||||
t.index ["unlock_token"], name: "index_members_on_unlock_token", unique: true, using: :btree
|
||||
t.index ["user_id"], name: "index_members_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "nrc"
|
||||
t.string "email"
|
||||
t.boolean "is_active", default: false
|
||||
t.string "phone"
|
||||
t.string "address"
|
||||
t.string "secrect_key"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user