zoukankan      html  css  js  c++  java
  • 在EF中做数据索引

    namespace MigrationsCodeDemo.Migrations
    {
        using System.Data.Entity.Migrations;

        public partial class AddPostClass : DbMigration
        {
            public override void Up()
            {
                CreateTable(
                    "Posts",
                    c => new
                        {
                            PostId = c.Int(nullable: false, identity: true),
                            Title = c.String(maxLength: 200),
                            Content = c.String(),
                            BlogId = c.Int(nullable: false),
                        })
                    .PrimaryKey(t => t.PostId)
                    .ForeignKey("Blogs", t => t.BlogId, cascadeDelete: true)
                    .Index(t => t.BlogId)
                    .Index(p => p.Title, unique: true);

                AddColumn("Blogs", "Rating", c => c.Int(nullable: false, defaultValue: 3));
            }

        }
    }

  • 相关阅读:
    Hbase表的管理
    Hbase指定规则扫描表
    vim配置
    caogao
    go on shell
    实习总结
    shell 脚本
    hadoop实战
    awk使用
    java reflect
  • 原文地址:https://www.cnblogs.com/jiangcm/p/7351274.html
Copyright © 2011-2022 走看看