Beispiel #1
0
        public void Setup()
        {
            var migration = new ConcreteFluentMigration(x =>
            {
                x.Schema.AlterTable("Company", t =>
                {
                    t.AddColumn <string>("Name", 25);
                    t.DropColumn("Foobar");
                    t.RenameColumn("Blah", "Yadda");
                });
            });

            context = new MockMigrationContext();
            migration.Initialize(context);

            migration.Up();
        }
    public void Setup()
    {
      var migration = new ConcreteFluentMigration(x=>
      {
        var company = x.Schema.CreateTable("Company", t=>
        {
          t.AddPrimaryKey<int>("Id").Identity();
          t.AddColumn<string>("Name", 25).Unique();
        });

        x.Schema.CreateTable("Project", t=>
        {
          t.AddPrimaryKey<int>("Id").Identity();
          t.AddColumn<string>("Name", 25);
          t.AddForeignKey("CompanyID", company);
        });
      });

      context = new MockMigrationContext();
      migration.Initialize(context);

      migration.Up();
    }
Beispiel #3
0
        public void Setup()
        {
            var migration = new ConcreteFluentMigration(x =>
            {
                var company = x.Schema.CreateTable("Company", t =>
                {
                    t.AddPrimaryKey <int>("Id").Identity();
                    t.AddColumn <string>("Name", 25).Unique();
                });

                x.Schema.CreateTable("Project", t =>
                {
                    t.AddPrimaryKey <int>("Id").Identity();
                    t.AddColumn <string>("Name", 25);
                    t.AddForeignKey("CompanyID", company);
                });
            });

            context = new MockMigrationContext();
            migration.Initialize(context);

            migration.Up();
        }
        public void Setup()
        {
            var migration = new ConcreteFluentMigration(x=>
              {
            x.Schema.AlterTable("Company", t=>
            {
              t.AddColumn<string>("Name", 25);
              t.DropColumn("Foobar");
              t.RenameColumn("Blah", "Yadda");
            });
              });

              context = new MockMigrationContext();
              migration.Initialize(context);

              migration.Up();
        }