<div dir="ltr">If you've got things like views that need handling as well your best bet is probably Andrew's recommendation of setting the schema format to SQL - once you're building views you've lost the benefit of being able to migrate database engines anyway so there's no real benefit to translating all the SQL into Ruby.<div><br></div><div>Once you've done that it should just be a case of creating the schema_migrations table, and then writing migrations for any future changes you want to make.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 17 Mar 2016 at 09:58 Andrew Premdas <<a href="mailto:apremdas@gmail.com">apremdas@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Bit of googling found <a href="https://gist.github.com/vjt/4548844" target="_blank">https://gist.github.com/vjt/4548844</a> - hopefully its useful. You'll probably have to create the database first, either using pg_create or the rails rake task. Also I'd recommend setting<br><br> <span>`Rails</span>.application.config.active_record.schema_format` to <span>:sql in application.rb<br><br></span></div><span>Hope that helps<br></span></div><div class="gmail_extra"></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 March 2016 at 04:14, gvim <span dir="ltr"><<a href="mailto:gvimrc@gmail.com" target="_blank">gvimrc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A while back I discovered a gem which generates Rails models from an existing database. Can you think of any?<span><font color="#888888"><br>
<br>
gvim</font></span><div><div><br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div><div class="gmail_extra">-- <br><div><div>------------------------</div>Andrew Premdas<div><a href="http://blog.andrew.premdas.org" target="_blank">blog.andrew.premdas.org</a></div></div>
</div>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div>