Recently I wanted use the Fluent migrator for seeding my postgres database, which was running as a docker container. I basically had a table User, which had a primary key of type UUID that needs to be auto-generated. My migration code looked as follows. Create.Table(User.TABLE_NAME) .WithColumn("id").AsGuid().NotNullable().WithDefaultValue(SystemMethods.NewGuid).PrimaryKey() .WithColumn("username").AsString().NotNullable() .WithColumn("password").AsString().NotNullable(); The above code would essentially turn out as the following postgres sql. … Continue reading Install Extensions in Postgres Docker container
Tag: FluentMigrator
Seed Postgres Database with FluentMigrator
In this blog post, we will address how to seed your Postgres Database when using FluentMigrator. In the example context, we have a Postges Database running on a docker container, and have a Web Api connecting to the database using Dapper. Dapper is a micro-orm, and while it is pretty good in what is does, … Continue reading Seed Postgres Database with FluentMigrator