1
我有同治工作室的MS SQL Server 2012的實例,我有一個包含以下schema.rb文件:如何從schema.rb文件生成SQL Server數據庫?
# This file is auto-generated from the current state of the database.
# Note that this schema.rb definition is the authoritative source for your database schema.
ActiveRecord::Schema.define(:version => 20120525100324) do
create_table "academic_details", :force => true do |t|
t.integer "registration_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "additional_exam_groups", ["school_id"], :name => "index_additional_exam_groups_on_school_id", :limit => {"school_id"=>nil}
create_table "additional_exam_scores", :force => true do |t|
t.integer "student_id"
t.integer "additional_exam_id"
t.decimal "marks", :precision => 7, :scale => 2
t.integer "grading_level_id"
t.string "remarks"
t.boolean "is_failed"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "school_id"
end.................etc.
如何從文件生成SQL Server數據庫?
感謝@theSshow,我在瀏覽一個開源項目 https://github.com/projectfedena/fedena 我只想發現數據庫設計/模式,那麼最好的方法是什麼?我使用ms sql server 2012並從未遇到過mysql或ruby。 –
你只是想用fedena項目中的模式定義來設置一個獨立的數據庫,還是你想設置一個Rails應用程序?如果設置Rails應用程序,並且您想要使用MS SQL Server,則必須使用[activerecord-sqlserver-adapter gem](https://github.com/rails-sqlserver/activerecord-sqlserver-適配器)。 – richsinn