这是格式化之前的代码:
class CreateStudents < ActiveRecord::Migration
def change
create_table :students, :comment => "学生信息表" do |t|
t.string :number, :comment => "学号"
t.string :name, :comment => "姓名"
t.date :birthday, :comment => "生日"
t.string :gender, :comment => "性别"
t.string :id_type, :comment => "证件类型"
t.string :id_number, :comment => "证件号码"
t.string :country, :comment => "国别"
t.string :nation, :comment => "民族"
t.string :birth_place, :comment => "籍贯"
t.string :political_status, :comment => "政治面貌"
t.string :education_level, :comment => "培养层次"
t.string :enroll_method, :comment => "入学方式"
t.date :enrolled_at, :comment => "入学时间"
t.string :charge_type, :comment => "收费类别"
t.string :enrolled_year, :comment => "学籍年度"
t.string :enrolled_place, :comment => "生源所在地"
t.string :bank_card_number, :comment => "银行卡号"
t.string :bank_account_number, :comment => "银行账号"
t.boolean :is_active_duty, :default => false, :comment => "是否现役军人"
t.boolean :is_equivalent_degree, :default => false, :comment => "是否同等学历"
t.boolean :is_on_record, :default => true, :comment => "是否在籍"
t.boolean :is_at_school, :default => true, :comment => "是否在校"
t.timestamps
end
end
end
这是格式化之后的代码:
class CreateStudents < ActiveRecord::Migration
def change
create_table :students, :comment => "学生信息表" do |t|
t.string :number, :comment => "学号"
t.string :name, :comment => "姓名"
t.date :birthday, :comment => "生日"
t.string :gender, :comment => "性别"
t.string :id_type, :comment => "证件类型"
t.string :id_number, :comment => "证件号码"
t.string :country, :comment => "国别"
t.string :nation, :comment => "民族"
t.string :birth_place, :comment => "籍贯"
t.string :political_status, :comment => "政治面貌"
t.string :education_level, :comment => "培养层次"
t.string :enroll_method, :comment => "入学方式"
t.date :enrolled_at, :comment => "入学时间"
t.string :charge_type, :comment => "收费类别"
t.string :enrolled_year, :comment => "学籍年度"
t.string :enrolled_place, :comment => "生源所在地"
t.string :bank_card_number, :comment => "银行卡号"
t.string :bank_account_number, :comment => "银行账号"
t.boolean :is_active_duty, :default => false, :comment => "是否现役军人"
t.boolean :is_equivalent_degree, :default => false, :comment => "是否同等学历"
t.boolean :is_on_record, :default => true, :comment => "是否在籍"
t.boolean :is_at_school, :default => true, :comment => "是否在校"
t.timestamps
end
end
end