Reputation: 614
I am trying to use Fluent Migrator to alter a table to add a column which is a Guid, not nullable and primary key.
Example: test_user (table)
+++++++++
col1 col2
+++++++++
test1 test2
test3 test4
+++++++++
I am using the below syntax to add a column to an existing table:
Alter.Table("test_user").AddColumn("test_user_id").AsGuid().NotNullable().WithDefault(SystemMethods.NewGuid);
Create.PrimaryKey("pk_test_user")
.OnTable("test_user").Column("test_user_id");
If the table has data like in the example it should add unique Guid's
error: "check the manual that corresponds to your MySQL server version for the right syntax to use near '(SELECT UUID())'"
Upvotes: 0
Views: 759