On Jun 24, 10:16 am, Jeremy Evans <[EMAIL PROTECTED]> wrote:
> On Jun 24, 8:28 am, Glen <[EMAIL PROTECTED]> wrote:
>
> > Is it possible to create a non-integer key with Sequel?
>
> Yes.
>
>   primary_key :name, :type=>:text
>   foreign_key :artist_name, :artists, :type=>:text
>
> Jeremy

Thanks for the response Jeremy.

However when I try this:

class Computers < Sequel::Model
  set_schema do
    primary_key :name, :type => :text
    varchar :os
    varchar :ip
    varchar :mac
  end
end

I get the following error:

Sequel::Error::InvalidStatement: CREATE TABLE `computers` (`name` text
PRIMARY KEY AUTOINCREMENT, `os` text, `ip` text, `mac` text)
AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY

I get the same error when I try it this way:

db = Sequel.sqlite(DB_NAME)

db.create_table :computers do
  primary_key :name, :type => :text
  column :os, :text
  column :ip, :text
  column :mac, :text
end

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to