Re: Postgres - how to create a table within a schema in a migration?

2018-04-08 Thread Greg Gilbert
Actually, nevermind, I figured it out: DB.create_schema(:foo) create_table(Sequel[:foo][:account]) do That notation isn't really documented anywhere; I had to dig into the tests to find it. On Sunday, April 8, 2018 at 7:30:35 PM UTC-4, Greg Gilbert wrote: > > Hey, > > Quick question:

Postgres - how to reference a schema in a model definition?

2018-04-08 Thread Greg Gilbert
Hey, Following up on my last message (which I closed myself), I'm looking to create a class that extends Sequel::Model and uses the schema in a connection. Here's an example: MyDB = Sequel.connect( adapter: 'postgres', host: ENV['MYDB_HOST'],

Postgres - how to create a table within a schema in a migration?

2018-04-08 Thread Greg Gilbert
Hey, Quick question: how do I create a table within a schema in migrations? This doesn't work: DB.create_schema(:foo) create_table(:"foo.account") do # stuff end I tried doing create_table(:account, schema: :foo) and that doesn't do anything either. Any ideas? Thanks, Greg

Re: Postgres - how to create a table within a schema in a migration?

2018-04-08 Thread Jeremy Evans
On Sunday, April 8, 2018 at 4:46:04 PM UTC-7, Greg Gilbert wrote: > > Actually, nevermind, I figured it out: > > DB.create_schema(:foo) > create_table(Sequel[:foo][:account]) do > > That notation isn't really documented anywhere; I had to dig into the > tests to find it. > It's mentioned

Re: Postgres - how to reference a schema in a model definition?

2018-04-08 Thread Jeremy Evans
On Sunday, April 8, 2018 at 5:05:39 PM UTC-7, Greg Gilbert wrote: > > Hey, > > Following up on my last message (which I closed myself), I'm looking to > create a class that extends Sequel::Model and uses the schema in a > connection. > > Here's an example: > > MyDB = Sequel.connect( >