context: namespace Realm.DAL.Migrations
  {
      using System.Data.Entity.Migrations;
      
      public partial class InitialSetup : DbMigration
      {
          public override void Up()
          {
              CreateTable(
                  "dbo.Abilities",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          ManaCost = c.Int(nullable: false),
                          StaminaCost = c.Int(nullable: false),
                          PreDelay = c.Single(nullable: false),
                          PostDelay = c.Single(nullable: false),
                          OffensiveStat = c.Int(nullable: false),
                          DefensiveStat = c.Int(nullable: false),
                          Bits = c.Int(nullable: false),
                          TerrainId = c.Int(),
                          TagSetId = c.Int(),
                          InterruptionResistSkillId = c.Int(),
                          InterruptionEffectId = c.Int(),
                          RechargeRate = c.Single(nullable: false),
                          TargetClass = c.Int(nullable: false),
                          VerbalText = c.String(),
                          BeginUseText = c.String(),
                          UseText = c.String(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Effects", t => t.InterruptionEffectId)
                  .ForeignKey("dbo.Skills", t => t.InterruptionResistSkillId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .ForeignKey("dbo.Terrains", t => t.TerrainId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.TerrainId)
                  .Index(t => t.TagSetId)
                  .Index(t => t.InterruptionResistSkillId)
                  .Index(t => t.InterruptionEffectId);
              
              CreateTable(
                  "dbo.AbilityEffects",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          EffectId = c.Int(nullable: false),
                          TargetClass = c.Int(nullable: false),
                          MaxNumber = c.Int(nullable: false),
                          AbilityId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Abilities", t => t.AbilityId)
                  .ForeignKey("dbo.Effects", t => t.EffectId)
                  .Index(t => t.EffectId)
                  .Index(t => t.AbilityId);
              
              CreateTable(
                  "dbo.Effects",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          EffectType = c.Int(nullable: false),
                          Duration = c.Int(nullable: false),
                          Bits = c.Int(nullable: false),
                          ResistStatistic = c.Int(nullable: false),
                          OnFailEffectId = c.Int(),
                          OnResistEffectId = c.Int(),
                          TagSetId = c.Int(),
                          MovementModeBitField = c.Int(nullable: false),
                          ApplicationTextSelf = c.String(),
                          ApplicationTextOther = c.String(),
                          FadeTextSelf = c.String(),
                          FadeTextOther = c.String(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Effects", t => t.OnFailEffectId)
                  .ForeignKey("dbo.Effects", t => t.OnResistEffectId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.OnFailEffectId)
                  .Index(t => t.OnResistEffectId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.EffectDynamicZones",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ZoneId = c.Int(),
                          EffectId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Effects", t => t.EffectId)
                  .ForeignKey("dbo.Zones", t => t.ZoneId)
                  .Index(t => t.ZoneId)
                  .Index(t => t.EffectId);
              
              CreateTable(
                  "dbo.Zones",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          Bits = c.Int(nullable: false),
                          RecycleTime = c.Int(nullable: false),
                          TagSetId = c.Int(),
                          MaxDynamicZones = c.Int(nullable: false),
                          MinDyanmicZoneFrequencySeconds = c.Int(nullable: false),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.ZoneAccesses",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          AccessName = c.String(nullable: false),
                          AccessValue = c.Int(nullable: false),
                          ZoneId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Zones", t => t.ZoneId)
                  .Index(t => t.ZoneId);
              
              CreateTable(
                  "dbo.ZoneDynamics",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          MaxNumberOfSpaces = c.Int(nullable: false),
                          MinNumberOfSpaces = c.Int(nullable: false),
                          DecayTimeInSeconds = c.Int(nullable: false),
                          AbilityId = c.Int(),
                          MobileId = c.Int(),
                          ZoneId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Abilities", t => t.AbilityId)
                  .ForeignKey("dbo.Mobiles", t => t.MobileId)
                  .ForeignKey("dbo.Zones", t => t.ZoneId)
                  .Index(t => t.AbilityId)
                  .Index(t => t.MobileId)
                  .Index(t => t.ZoneId);
              
              CreateTable(
                  "dbo.Mobiles",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          SizeType = c.Int(nullable: false),
                          MobileType = c.Int(nullable: false),
                          Bits = c.Int(nullable: false),
                          RaceId = c.Int(),
                          ConversationId = c.Int(),
                          AccessLevel = c.Int(nullable: false),
                          GenderType = c.Int(nullable: false),
                          Level = c.Int(nullable: false),
                          FactionId = c.Int(),
                          TagSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Conversations", t => t.ConversationId)
                  .ForeignKey("dbo.Factions", t => t.FactionId)
                  .ForeignKey("dbo.Races", t => t.RaceId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.RaceId)
                  .Index(t => t.ConversationId)
                  .Index(t => t.FactionId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.MobileAbilities",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          AbilityId = c.Int(),
                          IsDefault = c.Boolean(nullable: false),
                          MobileId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Abilities", t => t.AbilityId)
                  .ForeignKey("dbo.Mobiles", t => t.MobileId)
                  .Index(t => t.AbilityId)
                  .Index(t => t.MobileId);
              
              CreateTable(
                  "dbo.MobileAIs",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          MonsterClass = c.Int(nullable: false),
                          BehaviorId = c.Int(),
                          MobileId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Behaviors", t => t.BehaviorId)
                  .ForeignKey("dbo.Mobiles", t => t.MobileId)
                  .Index(t => t.BehaviorId)
                  .Index(t => t.MobileId);
              
              CreateTable(
                  "dbo.Behaviors",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          Bits = c.Int(nullable: false),
                          TagSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.SystemClasses",
                  c => new
                      {
                          Id = c.Int(nullable: false),
                          Name = c.String(maxLength: 50),
                          ParentClassId = c.Int(),
                          SystemType = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.ParentClassId)
                  .Index(t => t.ParentClassId);
              
              CreateTable(
                  "dbo.TagSets",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id);
              
              CreateTable(
                  "dbo.Tags",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          TagCategory = c.Int(nullable: false),
                          Name = c.String(maxLength: 50),
                          CreateDateUtc = c.DateTime(),
                          TagSet_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.TagSets", t => t.TagSet_Id)
                  .Index(t => t.TagSet_Id);
              
              CreateTable(
                  "dbo.Conversations",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          IsDefault = c.Boolean(nullable: false),
                          RequiredFactionId = c.Int(),
                          RequiredFactionLevel = c.Int(nullable: false),
                          TagSetId = c.Int(),
                          Keywords = c.String(nullable: false, maxLength: 255),
                          Text = c.String(nullable: false),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Factions", t => t.RequiredFactionId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.RequiredFactionId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.Factions",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          TagSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.FactionRelations",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          TargetFactionId = c.Int(),
                          FactionRelationshipType = c.Int(nullable: false),
                          FactionId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                          Faction_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Factions", t => t.FactionId)
                  .ForeignKey("dbo.Factions", t => t.TargetFactionId)
                  .ForeignKey("dbo.Factions", t => t.Faction_Id)
                  .Index(t => t.TargetFactionId)
                  .Index(t => t.FactionId)
                  .Index(t => t.Faction_Id);
              
              CreateTable(
                  "dbo.MobileEquipments",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(),
                          WornAtId = c.Int(),
                          Quantity = c.Int(nullable: false),
                          MobileId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Mobiles", t => t.MobileId)
                  .ForeignKey("dbo.WearLocations", t => t.WornAtId)
                  .Index(t => t.ItemId)
                  .Index(t => t.WornAtId)
                  .Index(t => t.MobileId);
              
              CreateTable(
                  "dbo.Items",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          ItemType = c.Int(nullable: false),
                          Weight = c.Int(nullable: false),
                          MaterialType = c.Int(nullable: false),
                          CoinValue = c.Int(nullable: false),
                          SizeType = c.Int(nullable: false),
                          MaxStackSize = c.Int(nullable: false),
                          Bits = c.Int(nullable: false),
                          ConditionType = c.Int(nullable: false),
                          UseAbilityId = c.Int(),
                          UseAbilityFrequency = c.Int(nullable: false),
                          SpotStatistic = c.Int(nullable: false),
                          SpotDifficultyType = c.Int(nullable: false),
                          TrapItemId = c.Int(),
                          TagSetId = c.Int(),
                          ItemClassType = c.Int(nullable: false),
                          ItemSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.ItemSets", t => t.ItemSetId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .ForeignKey("dbo.Items", t => t.TrapItemId)
                  .ForeignKey("dbo.Abilities", t => t.UseAbilityId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.UseAbilityId)
                  .Index(t => t.TrapItemId)
                  .Index(t => t.TagSetId)
                  .Index(t => t.ItemSetId);
              
              CreateTable(
                  "dbo.ItemBooks",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          Text = c.String(),
                          AbilityId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Abilities", t => t.AbilityId)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId)
                  .Index(t => t.AbilityId);
              
              CreateTable(
                  "dbo.ItemContainers",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          WeightAllowance = c.Int(nullable: false),
                          VolumeAllowance = c.Int(nullable: false),
                          LockItemId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                          Item_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Items", t => t.LockItemId)
                  .ForeignKey("dbo.Items", t => t.Item_Id)
                  .Index(t => t.ItemId)
                  .Index(t => t.LockItemId)
                  .Index(t => t.Item_Id);
              
              CreateTable(
                  "dbo.ItemDrinkContainers",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          LiquidId = c.Int(),
                          MaxCharges = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Liquids", t => t.LiquidId)
                  .Index(t => t.ItemId)
                  .Index(t => t.LiquidId);
              
              CreateTable(
                  "dbo.Liquids",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          ColorId = c.Int(),
                          ThirstPoints = c.Int(nullable: false),
                          DrunkPoints = c.Int(nullable: false),
                          CostPerCharge = c.Single(nullable: false),
                          FlammabilityType = c.Int(nullable: false),
                          TagSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Colors", t => t.ColorId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.ColorId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.Colors",
                  c => new
                      {
                          Id = c.Int(nullable: false),
                          Name = c.String(nullable: false, maxLength: 50),
                          Ascii = c.String(maxLength: 2),
                          Escape = c.String(maxLength: 10),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id);
              
              CreateTable(
                  "dbo.ItemFoods",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          HungerPoints = c.Int(nullable: false),
                          Charges = c.Int(nullable: false),
                          TimeFoodIsEdibleInSeconds = c.Int(nullable: false),
                          TimeFoodIsDecayingInSeconds = c.Int(nullable: false),
                          DecayDescription = c.String(),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId);
              
              CreateTable(
                  "dbo.ItemFormulaResources",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          ResourceItemId = c.Int(),
                          Quantity = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                          Item_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Items", t => t.ResourceItemId)
                  .ForeignKey("dbo.Items", t => t.Item_Id)
                  .Index(t => t.ItemId)
                  .Index(t => t.ResourceItemId)
                  .Index(t => t.Item_Id);
              
              CreateTable(
                  "dbo.ItemFormulas",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          SkillId = c.Int(),
                          SkillValue = c.Int(nullable: false),
                          ProductItemId = c.Int(nullable: false),
                          ProductQuantity = c.Int(nullable: false),
                          MachineItemId = c.Int(),
                          ToolItemId = c.Int(),
                          ExperienceValue = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Items", t => t.MachineItemId)
                  .ForeignKey("dbo.Items", t => t.ProductItemId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .ForeignKey("dbo.Items", t => t.ToolItemId)
                  .Index(t => t.ItemId)
                  .Index(t => t.SkillId)
                  .Index(t => t.ProductItemId)
                  .Index(t => t.MachineItemId)
                  .Index(t => t.ToolItemId);
              
              CreateTable(
                  "dbo.Skills",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          SkillCategoryId = c.Int(nullable: false),
                          Statistic = c.Int(nullable: false),
                          MaxValue = c.Int(nullable: false),
                          IsMasterable = c.Boolean(nullable: false),
                          ParentSkillId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Skills", t => t.ParentSkillId)
                  .ForeignKey("dbo.SkillCategories", t => t.SkillCategoryId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.SkillCategoryId)
                  .Index(t => t.ParentSkillId);
              
              CreateTable(
                  "dbo.SkillCategories",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          Statistic = c.Int(nullable: false),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .Index(t => t.SystemClassId);
              
              CreateTable(
                  "dbo.ItemFurnitures",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          MaxCapacity = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId);
              
              CreateTable(
                  "dbo.ItemSets",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .Index(t => t.SystemClassId);
              
              CreateTable(
                  "dbo.ItemSetBonuses",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemSetId = c.Int(nullable: false),
                          Statistic = c.Int(nullable: false),
                          SkillId = c.Int(),
                          ValueMod = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.ItemSets", t => t.ItemSetId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .Index(t => t.ItemSetId)
                  .Index(t => t.SkillId);
              
              CreateTable(
                  "dbo.ItemSetItems",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemSetId = c.Int(nullable: false),
                          ItemId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                          ItemSet_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.ItemSets", t => t.ItemSetId)
                  .ForeignKey("dbo.ItemSets", t => t.ItemSet_Id)
                  .Index(t => t.ItemSetId)
                  .Index(t => t.ItemId)
                  .Index(t => t.ItemSet_Id);
              
              CreateTable(
                  "dbo.ItemLights",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          FuelType = c.Int(nullable: false),
                          FuelItemId = c.Int(),
                          Charges = c.Int(nullable: false),
                          BurnRate = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                          Item_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.FuelItemId)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Items", t => t.Item_Id)
                  .Index(t => t.ItemId)
                  .Index(t => t.FuelItemId)
                  .Index(t => t.Item_Id);
              
              CreateTable(
                  "dbo.ItemLocks",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          PickStatistic = c.Int(nullable: false),
                          PickSkillId = c.Int(),
                          Difficulty = c.Int(nullable: false),
                          KeyItemId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                          Item_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Items", t => t.KeyItemId)
                  .ForeignKey("dbo.Skills", t => t.PickSkillId)
                  .ForeignKey("dbo.Items", t => t.Item_Id)
                  .Index(t => t.ItemId)
                  .Index(t => t.PickSkillId)
                  .Index(t => t.KeyItemId)
                  .Index(t => t.Item_Id);
              
              CreateTable(
                  "dbo.ItemMachines",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          MachineType = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId);
              
              CreateTable(
                  "dbo.ItemMagicalNodes",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          EffectId = c.Int(),
                          Duration = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Effects", t => t.EffectId)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId)
                  .Index(t => t.EffectId);
              
              CreateTable(
                  "dbo.ItemMudProgs",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          EventId = c.Int(),
                          MudProgId = c.Int(),
                          PercentChance = c.Single(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Events", t => t.EventId)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.MudProgs", t => t.MudProgId)
                  .Index(t => t.ItemId)
                  .Index(t => t.EventId)
                  .Index(t => t.MudProgId);
              
              CreateTable(
                  "dbo.Events",
                  c => new
                      {
                          Id = c.Int(nullable: false),
                          Name = c.String(nullable: false, maxLength: 50),
                          IsItemEvent = c.Boolean(nullable: false),
                          IsMobileEvent = c.Boolean(nullable: false),
                          IsSpaceEvent = c.Boolean(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id);
              
              CreateTable(
                  "dbo.MudProgs",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          Data = c.String(nullable: false),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .Index(t => t.SystemClassId);
              
              CreateTable(
                  "dbo.ItemPortals",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          DestinationId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Spaces", t => t.DestinationId)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId)
                  .Index(t => t.DestinationId);
              
              CreateTable(
                  "dbo.Spaces",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          Bits = c.Int(nullable: false),
                          TerrainId = c.Int(nullable: false),
                          AccessLevel = c.Int(nullable: false),
                          TagSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .ForeignKey("dbo.Terrains", t => t.TerrainId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.TerrainId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.SpacePortals",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          Direction = c.Int(nullable: false),
                          TargetSpaceId = c.Int(nullable: false),
                          BarrierId = c.Int(),
                          Bits = c.Int(nullable: false),
                          Keywords = c.String(nullable: false, maxLength: 255),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Barriers", t => t.BarrierId)
                  .ForeignKey("dbo.Spaces", t => t.TargetSpaceId)
                  .Index(t => t.TargetSpaceId)
                  .Index(t => t.BarrierId);
              
              CreateTable(
                  "dbo.Barriers",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          MaterialType = c.Int(nullable: false),
                          Bits = c.Int(nullable: false),
                          KeyItemId = c.Int(),
                          LockItemId = c.Int(),
                          TrapItemId = c.Int(),
                          TagSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.KeyItemId)
                  .ForeignKey("dbo.Items", t => t.LockItemId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .ForeignKey("dbo.Items", t => t.TrapItemId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.KeyItemId)
                  .Index(t => t.LockItemId)
                  .Index(t => t.TrapItemId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.Terrains",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          Bits = c.Int(nullable: false),
                          MovementCost = c.Int(nullable: false),
                          SkillId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.SkillId);
              
              CreateTable(
                  "dbo.TerrainRestrictions",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          TerrainId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                          MoementMode_Id = c.Int(nullable: false),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.MovementModes", t => t.MoementMode_Id)
                  .ForeignKey("dbo.Terrains", t => t.TerrainId)
                  .Index(t => t.TerrainId)
                  .Index(t => t.MoementMode_Id);
              
              CreateTable(
                  "dbo.MovementModes",
                  c => new
                      {
                          Id = c.Int(nullable: false),
                          Name = c.String(),
                          Value = c.Int(nullable: false),
                          ShortNamne = c.String(),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id);
              
              CreateTable(
                  "dbo.ItemPotions",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          AbilityId = c.Int(),
                          Charges = c.Int(nullable: false),
                          ColorId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Abilities", t => t.AbilityId)
                  .ForeignKey("dbo.Colors", t => t.ColorId)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId)
                  .Index(t => t.AbilityId)
                  .Index(t => t.ColorId);
              
              CreateTable(
                  "dbo.ItemPrerequisites",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          MinLevel = c.Int(nullable: false),
                          RaceId = c.Int(),
                          FactionId = c.Int(),
                          FactionLevel = c.Int(nullable: false),
                          Statistic = c.Int(nullable: false),
                          StatisticValue = c.Int(nullable: false),
                          SkillId = c.Int(),
                          SkillValue = c.Int(nullable: false),
                          Gender = c.Int(nullable: false),
                          ArchetypeId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Archetypes", t => t.ArchetypeId)
                  .ForeignKey("dbo.Factions", t => t.FactionId)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Races", t => t.RaceId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .Index(t => t.ItemId)
                  .Index(t => t.RaceId)
                  .Index(t => t.FactionId)
                  .Index(t => t.SkillId)
                  .Index(t => t.ArchetypeId);
              
              CreateTable(
                  "dbo.Archetypes",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          TagSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.ArchetypeAbilities",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          AbilityId = c.Int(),
                          IsExempt = c.Boolean(nullable: false),
                          IsAutoAttack = c.Boolean(nullable: false),
                          ArchetypeId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Abilities", t => t.AbilityId)
                  .ForeignKey("dbo.Archetypes", t => t.ArchetypeId)
                  .Index(t => t.AbilityId)
                  .Index(t => t.ArchetypeId);
              
              CreateTable(
                  "dbo.ArchetypeSkillCategories",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          SkillCategoryId = c.Int(),
                          IsPreferred = c.Boolean(nullable: false),
                          IsRestricted = c.Boolean(nullable: false),
                          ArchetypeId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Archetypes", t => t.ArchetypeId)
                  .ForeignKey("dbo.SkillCategories", t => t.SkillCategoryId)
                  .Index(t => t.SkillCategoryId)
                  .Index(t => t.ArchetypeId);
              
              CreateTable(
                  "dbo.ArchetypeStatistics",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          Statistic = c.Int(nullable: false),
                          SkillId = c.Int(),
                          ModValue = c.Int(nullable: false),
                          IsExempt = c.Boolean(nullable: false),
                          ArchetypeId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Archetypes", t => t.ArchetypeId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .Index(t => t.SkillId)
                  .Index(t => t.ArchetypeId);
              
              CreateTable(
                  "dbo.Races",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                          DisplayDescription = c.String(nullable: false, maxLength: 2048),
                          Bits = c.Int(nullable: false),
                          SizeType = c.Int(nullable: false),
                          BaseHealth = c.Int(nullable: false),
                          BaseMana = c.Int(nullable: false),
                          BaseStamina = c.Int(nullable: false),
                          Abbreviation = c.String(maxLength: 5),
                          TagSetId = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .ForeignKey("dbo.TagSets", t => t.TagSetId)
                  .Index(t => t.SystemClassId)
                  .Index(t => t.TagSetId);
              
              CreateTable(
                  "dbo.RaceAbilities",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          AbilityId = c.Int(),
                          RaceId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Abilities", t => t.AbilityId)
                  .ForeignKey("dbo.Races", t => t.RaceId)
                  .Index(t => t.AbilityId)
                  .Index(t => t.RaceId);
              
              CreateTable(
                  "dbo.RaceHitLocations",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          HitLocationId = c.Int(),
                          RaceId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.WearLocations", t => t.HitLocationId)
                  .ForeignKey("dbo.Races", t => t.RaceId)
                  .Index(t => t.HitLocationId)
                  .Index(t => t.RaceId);
              
              CreateTable(
                  "dbo.WearLocations",
                  c => new
                      {
                          Id = c.Int(nullable: false),
                          Name = c.String(),
                          Value = c.Int(nullable: false),
                          ShortNamne = c.String(),
                          LongName = c.String(),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id);
              
              CreateTable(
                  "dbo.RaceStatistics",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          Statistic = c.Int(nullable: false),
                          SkillId = c.Int(),
                          ValueMod = c.Int(nullable: false),
                          RaceId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Races", t => t.RaceId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .Index(t => t.SkillId)
                  .Index(t => t.RaceId);
              
              CreateTable(
                  "dbo.ItemResourceNodes",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          ResourceItemId = c.Int(),
                          ToolType = c.Int(nullable: false),
                          SkillId = c.Int(),
                          MinSkill = c.Int(nullable: false),
                          MinGatherAmount = c.Int(nullable: false),
                          MaxGatherAmount = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                          Item_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Items", t => t.ResourceItemId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .ForeignKey("dbo.Items", t => t.Item_Id)
                  .Index(t => t.ItemId)
                  .Index(t => t.ResourceItemId)
                  .Index(t => t.SkillId)
                  .Index(t => t.Item_Id);
              
              CreateTable(
                  "dbo.ItemStatistics",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          Statistic = c.Int(nullable: false),
                          SkillId = c.Int(),
                          ValueMod = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .Index(t => t.ItemId)
                  .Index(t => t.SkillId);
              
              CreateTable(
                  "dbo.ItemTools",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          ToolType = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId);
              
              CreateTable(
                  "dbo.ItemTraps",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          DisarmStatistic = c.Int(nullable: false),
                          DisarmSkillId = c.Int(),
                          Difficulty = c.Int(nullable: false),
                          OnFailTargetClassType = c.Int(nullable: false),
                          OnFailEffectId = c.Int(),
                          NotifyRadius = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Skills", t => t.DisarmSkillId)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Effects", t => t.OnFailEffectId)
                  .Index(t => t.ItemId)
                  .Index(t => t.DisarmSkillId)
                  .Index(t => t.OnFailEffectId);
              
              CreateTable(
                  "dbo.ItemTreasures",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          TreasureId = c.Int(),
                          Quantity = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Treasures", t => t.TreasureId)
                  .Index(t => t.ItemId)
                  .Index(t => t.TreasureId);
              
              CreateTable(
                  "dbo.Treasures",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          SystemName = c.String(nullable: false, maxLength: 255),
                          SystemClassId = c.Int(nullable: false),
                          DisplayName = c.String(nullable: false, maxLength: 255),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.SystemClasses", t => t.SystemClassId)
                  .Index(t => t.SystemClassId);
              
              CreateTable(
                  "dbo.TreasurePrimitives",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          CreateDateUtc = c.DateTime(),
                          PrimitiveId = c.Int(nullable: false),
                          Weight = c.Int(nullable: false),
                          MaxPulls = c.Int(nullable: false),
                          TreasureId = c.Int(nullable: false),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Treasures", t => t.TreasureId)
                  .Index(t => t.TreasureId);
              
              CreateTable(
                  "dbo.ItemVehicles",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          MaxCapacity = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .Index(t => t.ItemId);
              
              CreateTable(
                  "dbo.ItemVehicleTerrains",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemVehicleId = c.Int(nullable: false),
                          TerrainId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                          Item_Id = c.Int(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.ItemVehicles", t => t.ItemVehicleId)
                  .ForeignKey("dbo.Terrains", t => t.TerrainId)
                  .ForeignKey("dbo.Items", t => t.Item_Id)
                  .Index(t => t.ItemVehicleId)
                  .Index(t => t.TerrainId)
                  .Index(t => t.Item_Id);
              
              CreateTable(
                  "dbo.ItemWeapons",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          DamageType = c.Int(nullable: false),
                          MinDamage = c.Int(nullable: false),
                          MaxDamage = c.Int(nullable: false),
                          SkillId = c.Int(),
                          SpeedClassType = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
                  .Index(t => t.ItemId)
                  .Index(t => t.SkillId);
              
              CreateTable(
                  "dbo.ItemWearLocations",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          ItemId = c.Int(nullable: false),
                          WornAtId = c.Int(),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Items", t => t.ItemId)
                  .ForeignKey("dbo.WearLocations", t => t.WornAtId)
                  .Index(t => t.ItemId)
                  .Index(t => t.WornAtId);
              
              CreateTable(
                  "dbo.MobileMudProgs",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          EventId = c.Int(),
                          MudProgId = c.Int(),
                          PercentChance = c.Single(nullable: false),
                          MobileId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Events", t => t.EventId)
                  .ForeignKey("dbo.Mobiles", t => t.MobileId)
                  .ForeignKey("dbo.MudProgs", t => t.MudProgId)
                  .Index(t => t.EventId)
                  .Index(t => t.MudProgId)
                  .Index(t => t.MobileId);
              
              CreateTable(
                  "dbo.MobileResources",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          NodeItemId = c.Int(),
                          NodeType = c.Int(nullable: false),
                          MobileId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Mobiles", t => t.MobileId)
                  .ForeignKey("dbo.Items", t => t.NodeItemId)
                  .Index(t => t.NodeItemId)
                  .Index(t => t.MobileId);
              
              CreateTable(
                  "dbo.MobileStatistics",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          Statistic = c.Int(nullable: false),
                          SkillId = c.Int(),
                          Value = c.Int(nullable: false),
                          MobileId = c.Int(nullable: false),
                          CreateDateUtc = c.DateTime(),
                      })
                  .PrimaryKey(t => t.Id)
                  .ForeignKey("dbo.Mobiles", t => t.MobileId)
                  .ForeignKey("dbo.Skills", t => t.SkillId)
  
gt:                 .Index(t => t.SkillId)