Add primary key information to the DDL. Takes between one and three arguments. The last one is an options hash as for Generator#column. The first one distinguishes two modes: an array of existing column names adds a composite primary key constraint. A single symbol adds a new column of that name and makes it the primary key. In that case the optional middle argument denotes the type.
Examples:
primary_key(:id) primary_key(:zip_code, :null => false) primary_key([:street_number, :house_number]) primary_key(:id, :string, :auto_increment => false)
# File lib/sequel/database/schema_generator.rb, line 159 def primary_key(name, *args) return composite_primary_key(name, *args) if name.is_a?(Array) @primary_key = @db.serial_primary_key_options.merge({:name => name}) if opts = args.pop opts = {:type => opts} unless opts.is_a?(Hash) if type = args.pop opts.merge!(:type => type) end @primary_key.merge!(opts) end @primary_key end