Forum: Ruby on Rails Rake clone bug?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Robert J. (Guest)
on 2006-05-13 19:04
(Received via mailing list)
Hi.  I'm having a problem with my testing.  The following table in my
development database (MySQL 4.1.12, InnoDB):

+-----------------------+------------------------+------+-----+---------+----------------+
| Field                 | Type                   | Null | Key | Default |
Extra          |
+-----------------------+------------------------+------+-----+---------+----------------+
| pupil_set_id          | mediumint(10) unsigned |      | MUL | 0       |
|
| pupil_id              | mediumint(10) unsigned |      | MUL | 0       |
|
| link_id               | bigint(20) unsigned    |      | PRI | NULL    |
auto_increment |
| external_pupil_id     | int(11)                | YES  |     | NULL    |
|
| external_pupil_set_id | int(11)                | YES  |     | NULL    |
|              |
| setlink_end_date      | int(11)                | YES  |     | NULL    |
|
| setlink_start_date    | int(11)                |      |     | 0       |
|
+-----------------------+------------------------+------+-----+---------+----------------+

gets cloned by rake to:

+-----------------------+---------+------+-----+---------+-------+
| Field                 | Type    | Null | Key | Default | Extra |
+-----------------------+---------+------+-----+---------+-------+
| pupil_set_id          | int(10) |      | MUL | 0       |       |
| pupil_id              | int(10) |      | MUL | 0       |       |
| link_id               | int(20) |      |     | 0       |       |
| external_pupil_id     | int(11) | YES  |     | NULL    |       |
| external_pupil_set_id | int(11) | YES  |     | NULL    |       |
| setlink_end_date      | int(11) | YES  |     | NULL    |       |
| setlink_start_date    | int(11) |      |     | 0       |       |
+-----------------------+---------+------+-----+---------+-------+

which is missing the primary key and autoincrement for link_id, and has
link_id as int(20) which doesn't make sense!

Still the same problem when I pare down my setlinks.yml to

link1:
  link_id: 1
  pupil_id: 1
  pupil_set_id: 1
  setlink_end_date: NULL
  setlink_start_date: 1


Is it me, or is there a bug here in the way rake clones the db?

Robert J.
Robert J. (Guest)
on 2006-05-13 19:26
(Received via mailing list)
I fixed this by uncommenting the line in environment.rb and  changing it
to:

   config.active_record.schema_format = :sql

Still not sure why it wasn't working before though!


Robert



Robert J. wrote:

> Hi.  I'm having a problem with my testing.  The following table in my
> development database (MySQL 4.1.12, InnoDB):
>
>
+-----------------------+------------------------+------+-----+---------+----------------+
> | Field                 | Type                   | Null | Key | Default |
> Extra          |
>
+-----------------------+------------------------+------+-----+---------+----------------+
> | setlink_end_date      | int(11)                | YES  |     | NULL    |
> |
> | setlink_start_date    | int(11)                |      |     | 0       |
> |
>
+-----------------------+------------------------+------+-----+---------+----------------+
This topic is locked and can not be replied to.