Created
February 1, 2012 12:31
-
-
Save hudo/1716821 to your computer and use it in GitHub Desktop.
FluentMigrator primjer indexa i key-eva
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Migration(2)] | |
// Može se postaviti i timestamp umijesto rednog broja | |
// [Migration(201201311710)] | |
public class CreateUserTable : Migration | |
{ | |
public override void Up() | |
{ | |
Create.ForeignKey("fk_tag_user") | |
.FromTable("Tag").ForeignColumn("CreatorId") | |
.ToTable("User").PrimaryColumn("Id") | |
.OnDeleteOrUpdate(Rule.Cascade); | |
Create.Index("idx_tag_url").OnTable("Tag") | |
.OnColumn("ShortUrl").Ascending() | |
.WithOptions().NonClustered().Unique(); | |
} | |
public override void Down() | |
{ | |
Delete.ForeignKey("fk_tag_user"); | |
Delete.Index("idx_tag_url"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment