views:

35

answers:

1

I have a migration (v2) that creates a table and adds some columns:

TableSchema.Table layouts = CreateTableWithKey("Layouts");
layouts.AddColumn("UserID", DbType.UInt32);
layouts.AddColumn("WidgetID", DbType.UInt32);
layouts.AddColumn("Section", DbType.UInt32);
layouts.AddColumn("Rank", DbType.Int32);

Another migration (v3) adds a column to this table:

TableSchema.Table layouts = GetTable("Layouts");
layouts.AddColumn("Collapsed", DbType.Boolean);

The problem is, SubSonic 2 migration seems to ignore v3 statements. SubCommander reports success, but the new column is never added, and the generated SQL is missing anything defined in migration v3.

Am I missing something? Is it not possible to add columns to an existing table?

A: 

Hello, try to call

this.AddColumn("Collapsed", DbType.Boolean)

inside of your Up() method (i.e. try to call method of Migration class instead of Table)

alex