20210204114641_create_admin_departs.rb 588 B

12345678910111213141516171819202122232425
  1. # encoding:utf-8
  2. class CreateAdminDeparts < ActiveRecord::Migration
  3. def up
  4. #管理员部门管理
  5. create_table :admin_departs do |t|
  6. #管理员ID
  7. t.column :admin_user_id, :integer,:null=>false, :default => 0
  8. #部门ID
  9. t.column :depart_record_id, :integer,:null=>false, :default => 0
  10. # 备注
  11. t.column :remark, :string,:limit => 256
  12. t.timestamps
  13. end
  14. add_index :admin_departs, :admin_user_id
  15. add_column :order_details, :depart, :integer
  16. end
  17. def down
  18. drop_table :admin_departs
  19. drop_table :order_details
  20. end
  21. end