On Tuesday, October 2, 2012 2:30:09 AM UTC-7, Arne De Herdt wrote: > > Hello, > > I was looking through the documentation of Sequel, and came across the > migration section to create tables and views. > The documentation only gives examples on how to create_table should be > used in each case, but I'm looking for some input or examples on how to use > create_view to create views in database A with tables from database B. > > Concrete example, in database A we have a users table with around 30 > different fields. > In database B I want to create a view on this users table using only a > select number of fields. Can I do this through the migrations of Sequel, or > do I need to write the SQL manually? > Creating views in one database using tables from another database is going to be very specific to the type of database you are using. On MySQL, you could just qualify the tables correctly and use create_view (since MySQL treats databases as schemas), but on PostgreSQL you would probably have to use a foreign data wrapper to do that.
Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/1tZbRYimu7cJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
