CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 30 Jul 2025 10:37:24 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100421141827
location: https://web.archive.org/web/20100421141827/https://github.com/schambers/fluentmigrator
server-timing: captures_list;dur=0.609704, exclusion.robots;dur=0.017410, exclusion.robots.policy;dur=0.006802, esindex;dur=0.009206, cdx.remote;dur=579.496245, LoadShardBlock;dur=437.770357, PetaboxLoader3.datanode;dur=128.556541, PetaboxLoader3.resolve;dur=228.825043
x-app-server: wwwb-app239
x-ts: 302
x-tr: 1542
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: SERVER=wwwb-app239; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 30 Jul 2025 10:37:25 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Wed, 21 Apr 2010 14:18:27 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "0b2239db9ad6016fa0a73568ccf9d5eb"
x-archive-orig-x-runtime: 108ms
x-archive-orig-content-length: 29650
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Wed, 21 Apr 2010 14:18:27 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 09 Apr 2010 01:34:36 GMT", ; rel="prev memento"; datetime="Fri, 09 Apr 2010 01:34:36 GMT", ; rel="memento"; datetime="Wed, 21 Apr 2010 14:18:27 GMT", ; rel="next memento"; datetime="Mon, 01 Nov 2010 13:04:13 GMT", ; rel="last memento"; datetime="Thu, 14 Nov 2024 12:42:40 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_15_20100421132457_crawl100-c/52_15_20100421141636_crawl101.arc.gz
server-timing: captures_list;dur=0.379242, exclusion.robots;dur=0.011964, exclusion.robots.policy;dur=0.004940, esindex;dur=0.007102, cdx.remote;dur=146.712635, LoadShardBlock;dur=188.487713, PetaboxLoader3.datanode;dur=223.994434, PetaboxLoader3.resolve;dur=185.791058, load_resource;dur=236.266907
x-app-server: wwwb-app239
x-ts: 200
x-tr: 655
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
schambers's fluentmigrator at master - GitHub
schambers / fluentmigrator
- Source
- Commits
- Network (8)
- Issues (7)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
README.textile
compile the application and copy the required files over to the example project
src/FluentMigrator.Example/tools/FluentMigrator. cd into the example project and compile it:
FluentMigrator
Fluent migrations for .NET!
Project Info
- Project Home: code.google.com/p/fluentmigrator
- Discussions: fluentmigrator-google-group@googlegroups.com
- Bug/Feature Tracking: https://github.com/schambers/fluentmigrator/issues
h2. Getting started with the example project
The example project is a class library that contains the migrations, and a rakefile to wrap the Migrator.Console.exe calls.
You will need ruby, rubygems and the rake gem installed. Instructions to do this can be found here
Run
rake compile
from the command line in the projects root directory. This will compile the application and copy the required files over to the example project
src/FluentMigrator.Example/tools/FluentMigrator. cd into the example project and compile it:
cd src\FluentMigrator.Example
rake
rake -T
This will list the available commands
rake clean
rake compile
rake db:delete
rake db:migrate
rake db:migrate:up
rake db:migrate:down
rake db:rollback
The db:migrate commands can take an optional VERSION parameter
rake db:migrate VERSION=20090906205342
db:rollback can take an optional STEPS parameter.
rake db:rollback STEPS=2
Example Migration
[Migration(1)]
public class TestCreateAndDropTableMigration: Migration
{
public override void Up()
{
Create.Table("TestTable")
.WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity()
.WithColumn("Name").AsString(255).NotNullable().WithDefaultValue("Anonymous");
Create.Table("TestTable2")
.WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity()
.WithColumn("Name").AsString(255).Nullable()
.WithColumn("TestTableId").AsInt32().NotNullable();
Create.Index("ix_Name").OnTable("TestTable2").OnColumn("Name").Ascending()
.WithOptions().NonClustered();
Create.Column("Name2").OnTable("TestTable2").AsBoolean().Nullable();
Create.ForeignKey("fk_TestTable2_TestTableId_TestTable_Id")
.FromTable("TestTable2").ForeignColumn("TestTableId")
.ToTable("TestTable").PrimaryColumn("Id");
Insert.IntoTable("TestTable").Row(new { Name = "Test" });
}
public override void Down()
{
Delete.Table("TestTable2");
Delete.Table("TestTable");
}
}
Example usage of console runner
tools\fluentmigrator\FluentMigrator.Console.exe /connection "Data Source=db\db.sqlite;Version=3;" /db sqlite /target build\Migrations.dll
Example usage of NAnt runner
<?xml version="1.0" encoding="UTF-8" ?>
<project name="fluentmigrator" xmlns="https://nant.sf.net/release/0.85/nant.xsd" default="migrate">
<loadtasks assembly="../../build/FluentMigrator.NAnt.dll" />
<target name="migrate" description="Migrate the database to the latest version">
<migrate
database="sqlite"
connection="Data Source=:memory:;Version=3;New=True;"
namespace="FluentMigrator.Tests.Integration.Migrations.Interleaved.Pass3"
target="../../build/FluentMigrator.Tests.dll"
/>
</target>
<target name="migrate-rollback" description="Migrate the database back one version">
<migrate
database="sqlite"
connection="Data Source=:memory:;Version=3;New=True;"
namespace="FluentMigrator.Tests.Integration.Migrations.Interleaved.Pass3"
target="../../build/FluentMigrator.Tests.dll"
task="rollback"
/>
</target>
<target name="migrate-rollback-all" description="Migrates the database back to original state prior to applying migrations">
<migrate
database="sqlite"
connection="Data Source=:memory:;Version=3;New=True;"
namespace="FluentMigrator.Tests.Integration.Migrations.Interleaved.Pass3"
target="../../build/FluentMigrator.Tests.dll"
task="rollback:all"
/>
</target>
</project>