Just seen on c.l.py

See ActiveRecord::Migration

I don't see collate in there yet, but it shouldn't be a hard patch. I
know that you can give the table creation statement an option string
that gets appended to the table sql definition, so that's one part of
it.

···

On 7/17/05, JZ <usenet@zabiello.com> wrote:

On Sun, 17 Jul 2005 23:35:21 +0200, JZ wrote:

>> But it can certainly also be used to create your entire database from
>> scratch, so that you won't have to touch SQL at all. Example:
>>
>> create_table :system_settings do |t|
>> t.column :name, :string
>> t.column :label, :string
>> t.column :value, :text
>> t.column :type, :string
>> t.column :position, :integer
>> end
>
> David, how would you define collations or constrains here?

To be more specific... how to prepare "create_table :system_settings ..."
code for such table:

CREATE TABLE `book` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `book_id` varchar(3) character set utf8 NOT NULL default '',
  `chapter_nr` smallint(5) unsigned NOT NULL default '0',
  `verse_nr` smallint(5) unsigned NOT NULL default '0',
  `verse` text collate utf8_polish_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_uniq` (`book_id`,`chapter_nr`,`verse_nr`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci;

Which is basically what I was looking for. But I have to go poke around
with migrations, because it may make a few Rails things simpler.

Btw, stay tuned for *automatic* schema evolution coming to Og and
Nitro, real soon now :slight_smile:

regards,
George.

···

--

Joe Van Dyk wrote:

See ActiveRecord::Migration

I don't see collate in there yet, but it shouldn't be a hard patch. I
know that you can give the table creation statement an option string
that gets appended to the table sql definition, so that's one part of
it.

Does anyone know where that's documented? (It's an option hash, I believe).

Thanks,

James