When you say "if you just want things to work", does this mean that is unconventional to conditionally create the table before the class like that and there is some more preferred method of doing things?
On Monday, April 6, 2015 at 11:25:19 PM UTC+1, Jeremy Evans wrote: > > On Monday, April 6, 2015 at 3:01:50 PM UTC-7, Erik Griffin wrote: >> >> 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 >> > > If you just want things to work, above your model code (class User < > Sequel::Model) add: > > DB.create_table?(:users) do > primary_key :id > String :name > end > > This will create the users table if it does not already exist. > > Unfortunately, I don't think we have documentation aimed at starting > completely from scratch. The migrations guide ( > http://sequel.jeremyevans.net/rdoc/files/doc/migration_rdoc.html) > explains how migrations work, but assumes some knowledge and is more suited > to reference than teaching. > > If anyone wants to help out the project and send in a pull request for a > basic "starting from scratch" guide, I would be grateful. > > 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.
