Add migrations
This commit is contained in:
+17
-1
@@ -82,6 +82,15 @@
|
||||
<Compile Include="Entities\LeafInputStatusType.cs" />
|
||||
<Compile Include="Entities\LeafOutputFile.cs" />
|
||||
<Compile Include="Entities\PhotosynthesisType.cs" />
|
||||
<Compile Include="Migrations\201604151603282_InitialCreate.cs" />
|
||||
<Compile Include="Migrations\201604151603282_InitialCreate.Designer.cs">
|
||||
<DependentUpon>201604151603282_InitialCreate.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201605061427009_LeafInputUniqueToken.cs" />
|
||||
<Compile Include="Migrations\201605061427009_LeafInputUniqueToken.Designer.cs">
|
||||
<DependentUpon>201605061427009_LeafInputUniqueToken.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Parsers\LeafGasComparisonParser.cs" />
|
||||
<Compile Include="Remote\IPiscalClient.cs" />
|
||||
<Compile Include="Entities\FluxnetSite.cs" />
|
||||
@@ -124,7 +133,14 @@
|
||||
<None Include="Remote\piscal_launcher.sh" />
|
||||
<None Include="Remote\piscal_manager.sh" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Migrations\201604151603282_InitialCreate.resx">
|
||||
<DependentUpon>201604151603282_InitialCreate.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201605061427009_LeafInputUniqueToken.resx">
|
||||
<DependentUpon>201605061427009_LeafInputUniqueToken.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
@@ -31,6 +33,12 @@ namespace LeafWeb.Core.Entities
|
||||
[Required(ErrorMessage = "Site Id required")]
|
||||
public string SiteId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column(TypeName = "VARCHAR")]
|
||||
[StringLength(12)]
|
||||
[Index("IX_UniqueToken", 1, IsUnique = true)]
|
||||
public string UniqueToken { get; set; }
|
||||
|
||||
// [Required(ErrorMessage = "PhotosynthesisType required")]
|
||||
// http://stackoverflow.com/questions/6038541/ef-validation-failing-on-update-when-using-lazy-loaded-required-properties
|
||||
public virtual PhotosynthesisType PhotosynthesisType { get; set; }
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace LeafWeb.Core.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class InitialCreate : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(InitialCreate));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201604151603282_InitialCreate"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
namespace LeafWeb.Core.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class InitialCreate : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.FluxnetSite",
|
||||
c => new
|
||||
{
|
||||
FluxnetId = c.String(nullable: false, maxLength: 128),
|
||||
SiteName = c.String(),
|
||||
Country = c.String(),
|
||||
LandUnit = c.String(),
|
||||
})
|
||||
.PrimaryKey(t => t.FluxnetId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.LeafInputFile",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Filename = c.String(),
|
||||
Contents = c.Binary(),
|
||||
LeafInput_Id = c.Int(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.LeafInput", t => t.LeafInput_Id)
|
||||
.Index(t => t.LeafInput_Id);
|
||||
|
||||
CreateTable(
|
||||
"dbo.LeafInput",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
CurrentStatus = c.Int(nullable: false),
|
||||
Name = c.String(nullable: false),
|
||||
Email = c.String(nullable: false),
|
||||
Identifier = c.String(nullable: false),
|
||||
SiteId = c.String(nullable: false),
|
||||
Added = c.DateTime(nullable: false),
|
||||
PhotosynthesisType_Id = c.String(maxLength: 128),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.PhotosynthesisType", t => t.PhotosynthesisType_Id)
|
||||
.Index(t => t.PhotosynthesisType_Id);
|
||||
|
||||
CreateTable(
|
||||
"dbo.LeafOutputFile",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Filename = c.String(),
|
||||
Contents = c.Binary(),
|
||||
LeafInput_Id = c.Int(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.LeafInput", t => t.LeafInput_Id)
|
||||
.Index(t => t.LeafInput_Id);
|
||||
|
||||
CreateTable(
|
||||
"dbo.PhotosynthesisType",
|
||||
c => new
|
||||
{
|
||||
Id = c.String(nullable: false, maxLength: 128),
|
||||
Name = c.String(),
|
||||
SortOrder = c.Int(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.Id);
|
||||
|
||||
CreateTable(
|
||||
"dbo.LeafInputStatus",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Status = c.Int(nullable: false),
|
||||
Description = c.String(),
|
||||
Details = c.String(),
|
||||
DateTime = c.DateTime(nullable: false),
|
||||
LeafInput_Id = c.Int(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.LeafInput", t => t.LeafInput_Id)
|
||||
.Index(t => t.LeafInput_Id);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.LeafInputStatus", "LeafInput_Id", "dbo.LeafInput");
|
||||
DropForeignKey("dbo.LeafInput", "PhotosynthesisType_Id", "dbo.PhotosynthesisType");
|
||||
DropForeignKey("dbo.LeafOutputFile", "LeafInput_Id", "dbo.LeafInput");
|
||||
DropForeignKey("dbo.LeafInputFile", "LeafInput_Id", "dbo.LeafInput");
|
||||
DropIndex("dbo.LeafInputStatus", new[] { "LeafInput_Id" });
|
||||
DropIndex("dbo.LeafOutputFile", new[] { "LeafInput_Id" });
|
||||
DropIndex("dbo.LeafInput", new[] { "PhotosynthesisType_Id" });
|
||||
DropIndex("dbo.LeafInputFile", new[] { "LeafInput_Id" });
|
||||
DropTable("dbo.LeafInputStatus");
|
||||
DropTable("dbo.PhotosynthesisType");
|
||||
DropTable("dbo.LeafOutputFile");
|
||||
DropTable("dbo.LeafInput");
|
||||
DropTable("dbo.LeafInputFile");
|
||||
DropTable("dbo.FluxnetSite");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>H4sIAAAAAAAEAO1c3W7juBW+L9B3EHzVFlk7ybTANnB2kXXi1mgyCeLMtncBLdEOUYnyilRgo+iT9aKP1Fco9U9SJEX92HBmB3MTU+RH8pyP55CHPPO///x3+uMu8J13GBEU4uvRxfh85EDshh7Cm+tRTNfffT/68Yff/mZ65wU75+ei3qekHmuJyfXojdLt1WRC3DcYADIOkBuFJFzTsRsGE+CFk8vz8z9PLi4mkEGMGJbjTJ9jTFEA0x/s5yzELtzSGPgPoQd9kpezL8sU1fkMAki2wIXXo3sI1n+Hq/EsjOD49uZ+5Nz4CLBxLKG/HjkA45ACykZ59YXAJY1CvFluWQHwX/ZbyOqtgU9gPvqrqrrtRM4vk4lMqoYFlBsTGgYtAS8+5ZKZyM07yXdUSo7J7o7JmO6TWafyux7N/XiHIV0iyuYv93c186OkriThFARBMuYanznJp7OSDow1yT9WHPs0juA1hjGNgH/mPMUrH7l/g/uX8J8QX+PY9/khskGyb0IBK3qKwi2M6P4ZrsWBL7yRMxGbT+T2Zet602x2jBKM2yPnAezuId7QN8b6y+9HzhztoFeU5Bz5ghFbCqwRjWL28zMbPl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r54VRXSR/+/xPj1GNWr10b0xLfFV5Jot5KpHE5a33bz2Xu+6Q/mHX/DfL34UKjW+Vj0CHwXZzg+3kavlfzb6jc/bX17H6+rtaRXZVLx1KGVT9sKQsqc6+43QswVBZLsPmtGSPsztmsTBItkZgsvNDwGcmnNAIoPpVzFOEsIu2wK/NpR4qsVl8iZBLTPnLLdxCnKwq5VRtOmyKFpU9SBahSRaHTvoZlh784/0eGUMfgyDGZyAny5DW2U+6O4QeeUh9WDgQW6wecxzOrlh1Zn2zcUzqtM8HG9b5NKeNfy32xfzk5AQMjDoxrv6uXtapNu+tKe0tC+6znd0qZATINlOd8+Ka0+JU3UlVbDs0J84ZO2qZV2eRVqfrrlfqnWXmnarv42ToGYV8Sml86swdu2QgngGK90EfIkmvjxDq60D14OXD5N7pl5nuMakVS+yEe9LpdH0WiWgzbDLvhsmSq99qM+fL/d/hbBdA0KaCSC7rMXQFt1vWWeB1WOwBpBEVVaSwxgOkwGM++SaiaA1cyj67kBD+//a4C1bQW+BsqbApw2DlC+lVyS7C1H+aCiiOefqYhovIEFNgw0RJWOcR/xQj3yvHPVeE+jQQyfYkD6kluqRJaG2zL5Hq/7uVDigXX7mreoHB1mdg5BEvwTvsMrYvBN7DDXD3xeMEPUizIkSxT28R2EQgIDlG1Z79ZBz2gt0P/wdMKUisQl8AAA==</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace LeafWeb.Core.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class LeafInputUniqueToken : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(LeafInputUniqueToken));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201605061427009_LeafInputUniqueToken"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace LeafWeb.Core.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class LeafInputUniqueToken : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
AddColumn("dbo.LeafInput", "UniqueToken", c => c.String(nullable: false, maxLength: 12, unicode: false));
|
||||
Sql(@"UPDATE dbo.LeafInput SET UniqueToken = Id");
|
||||
CreateIndex("dbo.LeafInput", "UniqueToken", unique: true);
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropIndex("dbo.LeafInput", new[] { "UniqueToken" });
|
||||
DropColumn("dbo.LeafInput", "UniqueToken");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>H4sIAAAAAAAEAO1c3W7juBW+L9B3EHzVFlk7ybTANkh2kXXi1mgyCeLMtncBY9EOUYnyilRgo+iT9aKP1FcoqV+SIinqx4YzO5ibmCI/kud8PIc85Jn//ee/lz9uw8B7hzFBEb4anY1PRx7Ey8hHeH01Sujqu+9HP/7w299c3vrh1vu5qPeJ12MtMbkavVG6uZhMyPINhoCMQ7SMIxKt6HgZhRPgR5Pz09M/T87OJpBBjBiW510+JZiiEKY/2M9phJdwQxMQ3Ec+DEhezr4sUlTvMwgh2YAlvBrdQbD6O3wdT6MYjm+u70bedYAAG8cCBquRBzCOKKBslBdfCFzQOMLrxYYVgOB5t4Gs3goEBOajv6iqu07k9JxPZFI1LKCWCaFR2BLw7FMumYnavJN8R6XkmOxumYzpjs86ld/VaBYkWwzpAlE2f7W/i2kQ87qKhFMQBMlYaHzi8U8nJR0Ya/g/VpwENInhFYYJjUFw4j0mrwFa/g3unqN/QnyFkyAQh8gGyb5JBazoMY42MKa7J7iSBz73R95Ebj5R25et602z2TFKMG6PvHuwvYN4Td8Y68+/H3kztIV+UZJz5AtGbCmwRjRO2M/PbPjgNYDld0F6C8pE8heIYQwo9B8BpTBmFPgcYVgbtDJELlL+l2WE7E+nEdo7mkZs2cW7vfdzB7DPGtCBO7qcVIy28pwTeI43CZ2hoAPTpeYH53oXklfsnmP66bwTU+c+TOXYpFwuFHwYtmLKhkSKjn5CGHDyunSkIH8G72idzl5laqHqkfcEg7QGeUObzJlURHgp6cBGM4uj8CkKxNbC95dnEK8hp35kqbSIknjZm949qP2N1irbkj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H+Iq/R+rQxyCI9T3I0TKkdRqU6TKhR0JSHxYOxBanVx37sytOnTlfcRySOu0Tw4Z1Ps3541+LfbG/PTkCA6PPkKs/sFd1akyAa8p/y6L8bGf3GjECZJupzglyzflxuu6UKq4d2jPorB21TLBzyK8zddcrB88xBU/X92FS9axCPqZ8Pn0Kj1tWkMgAzUOhD5Gt10cI9XWge/nyYZLwzMvM9KrUiSVuwj3qvLo+i0S2GS4peMOky9Wvt5nzFf4PcbYLIGhdQfBbewyXktst68zxKir2AMqIiipKWOMeUuAzn3wdU7QCS8o+LyEh4n/ycRu+Qn+Os6XCpgzD10DKs+K7CFv/aU6gPObLhzRcRIaYAhsm4mGdB/xTggK/HPdME+ozQPDtSR5S47qkPLS23pVI9f/mygSUi6/cVT3DcBMwMPKAF+AddhnbFwLv4Bosd8UrBTNIsyJksV/eILCOQUhyjKo9+8k47IfbH/4PUaDN3kpfAAA=</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace LeafWeb.Core.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Linq;
|
||||
|
||||
internal sealed class Configuration : DbMigrationsConfiguration<LeafWeb.Core.DAL.LeafWebContext>
|
||||
{
|
||||
public Configuration()
|
||||
{
|
||||
AutomaticMigrationsEnabled = false;
|
||||
ContextKey = "LeafWeb.Core.DAL.LeafWebContext";
|
||||
}
|
||||
|
||||
protected override void Seed(LeafWeb.Core.DAL.LeafWebContext context)
|
||||
{
|
||||
// This method will be called after migrating to the latest version.
|
||||
|
||||
// You can use the DbSet<T>.AddOrUpdate() helper extension method
|
||||
// to avoid creating duplicate seed data. E.g.
|
||||
//
|
||||
// context.People.AddOrUpdate(
|
||||
// p => p.FullName,
|
||||
// new Person { FullName = "Andrew Peters" },
|
||||
// new Person { FullName = "Brice Lambson" },
|
||||
// new Person { FullName = "Rowan Miller" }
|
||||
// );
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user