Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #3735: ar-primary-key-test.txt

File ar-primary-key-test.txt, 1.0 kB (added by nathaniel@talbott.ws, 3 years ago)

Test showing the bug.

Line 
1 ==== Patch <ar-primary-key-test> level 1
2 Source: 33e8db4d-e946-4294-96a4-48b30eebde23:/local/rails/ar-primary-key:6586 [local]
3 Target: 33e8db4d-e946-4294-96a4-48b30eebde23:/local/rails/main:6584 [local]
4 Log:
5  r6585@jacob:  ntalbott | 2006-03-22 19:09:44 -0500
6  Branch
7  r6586@jacob:  ntalbott | 2006-03-22 19:10:50 -0500
8  Added failing test.
9
10 === activerecord/test/active_schema_mysql.rb
11 ==================================================================
12 --- activerecord/test/active_schema_mysql.rb    (revision 6584)
13 +++ activerecord/test/active_schema_mysql.rb    (patch ar-primary-key-test level 1)
14 @@ -20,6 +20,10 @@
15      assert_equal "ALTER TABLE people ADD last_name varchar(255)", add_column(:people, :last_name, :string)
16    end
17    
18 +  def test_add_primary_key_column
19 +    assert_equal "ALTER TABLE people ADD id int(11) DEFAULT NULL auto_increment PRIMARY KEY", add_column(:people, :id, :primary_key)
20 +  end
21
22    def test_add_column_with_limit
23      assert_equal "ALTER TABLE people ADD key varchar(32)", add_column(:people, :key, :string, :limit => 32)
24    end