001_AddAddressTable.cs 576 B

123456789101112131415161718192021
  1. using Migrator.Framework;
  2. using System.Data;
  3. [Migration(1)]
  4. public class AddAddressTable : Migration
  5. {
  6. override public void Up()
  7. {
  8. Database.AddTable("Address",
  9. new Column("id", DbType.Int32, ColumnProperty.PrimaryKey),
  10. new Column("street", DbType.String, 50),
  11. new Column("city", DbType.String, 50),
  12. new Column("state", DbType.StringFixedLength, 2),
  13. new Column("postal_code", DbType.String, 10)
  14. );
  15. }
  16. override public void Down()
  17. {
  18. Database.RemoveTable("Address");
  19. }
  20. }