'Connect' a rails app to an already existing MySQL DB?

前端 未结 3 1183
执念已碎
执念已碎 2021-01-07 12:42

So in my company we are slowly moving to Rails instead of PHP(Code Igniter to be precise). So, our actual PHP App is using a Mysql DB and I\'d like to connect a new Rails ap

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-07 13:02

    There shouldn't be any harm in connecting your rails app to an existing database. You will need to watch for anything that goes against rails conventions (table names are plurals of models, for example) and either change the database (and your php app) or program around the problem in rails.

    But the first step is simply to connect to the database and make models for the existing tables and see what works and what doesn't.

    After that, post here with any specific problems.

    As a suggestion, take a backup of your database and start out programming against that to build your application and be sure everything works safely.

提交回复
热议问题