1

I have an MS SQL Server 2012 instance with managment studio and I have schema.rb file which contains the following:

# 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.   

How to generate SQL Server database from that file?

Ramy Yousef
  • 2,982
  • 2
  • 25
  • 24

1 Answers1

1

First, is your Rails app properly configured to use MS SQL Server 2012 as its DB?

If so, try running rake db:schema:load task.

If that doesn't work, try running the rake db:setup task.

You can find more detailed information about the rake tasks here in this previous Stackoverflow answer: https://stackoverflow.com/a/10302357/631834

Community
  • 1
  • 1
richsinn
  • 1,341
  • 1
  • 12
  • 27
  • Thanks @theSshow, I was browsing an open source project https://github.com/projectfedena/fedena I want just to discover the database design/schema, what is the best way to do that? I'm using ms sql server 2012 and never encountered mysql or ruby before. – Ramy Yousef Apr 17 '14 at 14:55
  • Do you just want to set up a standalone database with the schema definition from the fedena project, or do you want to set up a Rails app? If setting up a Rails app, and you want to use a MS SQL Server, you'll have to probably use the [activerecord-sqlserver-adapter gem](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter). – richsinn Apr 17 '14 at 17:50