Can you give me a clear example of how to best start a new model and 
database from scratch? I have been unable to find any github projects to 
help guide me, and I don't understand the process.  Would I have to call 
create_table somewhere before I can use a Model? I'm sorry but I'm 
desperately trying to wrap my head around this and the documentation seems 
good for explaining individual methods but not how they all fit together in 
the context of starting from scratch

On Monday, April 6, 2015 at 4:01:36 PM UTC+1, Jeremy Evans wrote:
>
> On Monday, April 6, 2015 at 7:42:27 AM UTC-7, Erik Griffin wrote:
>>
>> Hi, I would very much like to begin using Sequel, but I am having some 
>> trouble getting it to work.
>>
>> I wanted to make a basic model and run some Rspec tests.
>>
>> I have a user.rb file which looks like this:
>>
>> require 'sequel'
>>
>> class User < Sequel::Model
>>   
>>   primary_key :id
>>   String :name
>>
>
> You appear to be trying to use Database schema modification methods inside 
> a model.  Don't do that.  Sequel will introspect your database to get the 
> information for the model.
>
> If you want to modify the database to add a table for the model, it's best 
> to use migrations. See:
>
> http://sequel.jeremyevans.net/rdoc/files/doc/schema_modification_rdoc.html
> http://sequel.jeremyevans.net/rdoc/files/doc/migration_rdoc.html
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to