I’m using MySQL for development and Oracle for testing and production. I need to create a database view with migrations and this feature is not available through migration DSL, so, to create the view, I’ll need to put raw SQL code in migration.
What is the best way to do this, keeping the migration working for Oracle and MySQL?
"Gustavo de Sá Carvalho Honorato" <gustavohonorato wrote in post
#966922:
Hi,
I'm using MySQL for development and Oracle for testing and production. I
need to create a database view with migrations and this feature is not
available through migration DSL, so, to create the view, I'll need to
put
raw SQL code in migration.
No you won't. Just use the rails_sql_views plugin.
Probably not a JRuby issue (though from the stack trace, it looks like
it might be a JdbcAdapter issue). AFAIK that gem is pure Ruby, so it
should work. Try it with MRI?
Probably not a JRuby issue (though from the stack trace, it looks like
it might be a JdbcAdapter issue). AFAIK that gem is pure Ruby, so it
should work. Try it with MRI?
I can't use MRI. The project I'm working uses some Java Libs and JRuby
make more easy this integration. I went back and tried to create the
views with raw SQL, but the views are not dumped to schema.rb. I'm
stuck without any ideas and my deadline is comming :(.
I thought to reimplement this plugin, but I have no experience doing
this. Do you have any suggestions?
Probably not a JRuby issue (though from the stack trace, it looks like
it might be a JdbcAdapter issue). AFAIK that gem is pure Ruby, so it
should work. Try it with MRI?
I can't use MRI.
You should at least be able to test the plugin with it, even if you
can't use it for this project.
The project I'm working uses some Java Libs and JRuby
make more easy this integration.
MRI + RJB is feasible too. Depends on how you need the Java stuff.
I went back and tried to create the
views with raw SQL, but the views are not dumped to schema.rb. I'm
stuck without any ideas and my deadline is comming :(.
You could set the schema_dumper to use SQL, but don't do that.
I thought to reimplement this plugin, but I have no experience doing
this. Do you have any suggestions?
It probably wouldn't be hard to patch the plugin to work with JDBC, if
that's where your problem is. It's generating pretty simple SQL. Just
look at how it generates the SQL for the adapters that it does support.
I had to do something similar when I patched Foreigner to support MS SQL
Server. It was really pretty easy.
Probably not a JRuby issue (though from the stack trace, it looks like
it might be a JdbcAdapter issue). AFAIK that gem is pure Ruby, so it
should work. Try it with MRI?
I can't use MRI.
You should at least be able to test the plugin with it, even if you
can't use it for this project.
The project I'm working uses some Java Libs and JRuby
make more easy this integration.
MRI + RJB is feasible too. Depends on how you need the Java stuff.
I went back and tried to create the
views with raw SQL, but the views are not dumped to schema.rb. I'm
stuck without any ideas and my deadline is comming :(.
You could set the schema_dumper to use SQL, but don't do that.
I thought to reimplement this plugin, but I have no experience doing
this. Do you have any suggestions?
It probably wouldn't be hard to patch the plugin to work with JDBC, if
that's where your problem is. It's generating pretty simple SQL. Just
look at how it generates the SQL for the adapters that it does support.
I had to do something similar when I patched Foreigner to support MS SQL
Server. It was really pretty easy.
Thanks Marnen, I'll try to do this. I'll come back when have news.
Probably not a JRuby issue (though from the stack trace, it looks like
it might be a JdbcAdapter issue). AFAIK that gem is pure Ruby, so it
should work. Try it with MRI?
I can't use MRI.
You should at least be able to test the plugin with it, even if you
can't use it for this project.
The project I'm working uses some Java Libs and JRuby
make more easy this integration.
MRI + RJB is feasible too. Depends on how you need the Java stuff.
I went back and tried to create the
views with raw SQL, but the views are not dumped to schema.rb. I'm
stuck without any ideas and my deadline is comming :(.
You could set the schema_dumper to use SQL, but don't do that.
I thought to reimplement this plugin, but I have no experience doing
this. Do you have any suggestions?
It probably wouldn't be hard to patch the plugin to work with JDBC, if
that's where your problem is. It's generating pretty simple SQL. Just
look at how it generates the SQL for the adapters that it does support.
I had to do something similar when I patched Foreigner to support MS SQL
Server. It was really pretty easy.
Thanks Marnen, I'll try to do this. I'll come back when have news.