additional indizes and SongNumber Column

This commit is contained in:
2019-03-17 21:23:41 +01:00
parent e115301ea2
commit 4f06467469
11 changed files with 266 additions and 5 deletions

View File

@@ -137,6 +137,10 @@
<Compile Include="Migrations\201903161558469_Init.Designer.cs">
<DependentUpon>201903161558469_Init.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201903172015115_SongNumber.cs" />
<Compile Include="Migrations\201903172015115_SongNumber.Designer.cs">
<DependentUpon>201903172015115_SongNumber.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@@ -167,6 +171,9 @@
<EmbeddedResource Include="Migrations\201903161558469_Init.resx">
<DependentUpon>201903161558469_Init.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201903172015115_SongNumber.resx">
<DependentUpon>201903172015115_SongNumber.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

View File

@@ -0,0 +1,29 @@
// <auto-generated />
namespace API.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class SongNumber : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(SongNumber));
string IMigrationMetadata.Id
{
get { return "201903172015115_SongNumber"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@@ -0,0 +1,62 @@
namespace API.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class SongNumber : DbMigration
{
public override void Up()
{
DropForeignKey("dbo.Changes", "UserId", "dbo.Users");
DropForeignKey("dbo.Changes", "Song_ID", "dbo.Songs");
DropIndex("dbo.Changes", new[] { "UserId" });
DropIndex("dbo.Changes", new[] { "Song_ID" });
DropPrimaryKey("dbo.Changes");
DropPrimaryKey("dbo.Users");
DropPrimaryKey("dbo.Files");
DropPrimaryKey("dbo.Songs");
AddColumn("dbo.Changes", "User_ID", c => c.Long());
AddColumn("dbo.Songs", "Number", c => c.Int(nullable: false));
AlterColumn("dbo.Changes", "ID", c => c.Long(nullable: false, identity: true));
AlterColumn("dbo.Changes", "Song_ID", c => c.Long());
AlterColumn("dbo.Users", "ID", c => c.Long(nullable: false, identity: true));
AlterColumn("dbo.Files", "ID", c => c.Long(nullable: false, identity: true));
AlterColumn("dbo.Songs", "ID", c => c.Long(nullable: false, identity: true));
AddPrimaryKey("dbo.Changes", "ID");
AddPrimaryKey("dbo.Users", "ID");
AddPrimaryKey("dbo.Files", "ID");
AddPrimaryKey("dbo.Songs", "ID");
CreateIndex("dbo.Changes", "User_ID");
CreateIndex("dbo.Changes", "Song_ID");
AddForeignKey("dbo.Changes", "User_ID", "dbo.Users", "ID");
AddForeignKey("dbo.Changes", "Song_ID", "dbo.Songs", "ID");
}
public override void Down()
{
DropForeignKey("dbo.Changes", "Song_ID", "dbo.Songs");
DropForeignKey("dbo.Changes", "User_ID", "dbo.Users");
DropIndex("dbo.Changes", new[] { "Song_ID" });
DropIndex("dbo.Changes", new[] { "User_ID" });
DropPrimaryKey("dbo.Songs");
DropPrimaryKey("dbo.Files");
DropPrimaryKey("dbo.Users");
DropPrimaryKey("dbo.Changes");
AlterColumn("dbo.Songs", "ID", c => c.Int(nullable: false, identity: true));
AlterColumn("dbo.Files", "ID", c => c.Int(nullable: false, identity: true));
AlterColumn("dbo.Users", "ID", c => c.Int(nullable: false, identity: true));
AlterColumn("dbo.Changes", "Song_ID", c => c.Int());
AlterColumn("dbo.Changes", "ID", c => c.Int(nullable: false, identity: true));
DropColumn("dbo.Songs", "Number");
DropColumn("dbo.Changes", "User_ID");
AddPrimaryKey("dbo.Songs", "ID");
AddPrimaryKey("dbo.Files", "ID");
AddPrimaryKey("dbo.Users", "ID");
AddPrimaryKey("dbo.Changes", "ID");
CreateIndex("dbo.Changes", "Song_ID");
CreateIndex("dbo.Changes", "UserId");
AddForeignKey("dbo.Changes", "Song_ID", "dbo.Songs", "ID");
AddForeignKey("dbo.Changes", "UserId", "dbo.Users", "ID", cascadeDelete: true);
}
}
}

View File

@@ -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>H4sIAAAAAAAEAO0bXW/bNvB9wP6DoKdtyKIkHYYtsFtkblIYW5ogTtu9FYzEOMQkyhWpIMGwX7aH/aT9hR1FieKXbMmOvWwoChTJiTzeN++Ol7///Gv06iFLg3tcMJLTcXi4fxAGmMZ5Quh8HJb89tsfwlcvv/xidJpkD8H7Zt0LsQ52UjYO7zhfHEcRi+9whth+RuIiZ/kt34/zLEJJHh0dHPwYHR5GGFCEgCsIRlcl5STD1S/w6ySnMV7wEqXneYJTVsPhy6zCGrxFGWYLFONxeHI53X+NOLpBDIfBSUoQ0DDD6W0YIEpzjjhQePyO4RkvcjqfLQCA0uvHBYZ1tygVuyrKj9vlfZk4OBJMRO3GBlVcMp5nAxEevqilEtnb15JtqKQGcjsF+fJHwXUlu3E4uUN0DqzbRx1P0kIsk4KV4t+Xi/cC+eue0juYh/i3F0zKlJcFHlNc8gKle8FleZOS+Gf8eJ3/humYlmmq0wMUwTcDAKDLIl/ggj9e4duayunrMIjMfZG9UW3T9kgOppR//10YvIXD0U2Klbo1bmc8L/AbTHGBOE4uEee4AG1NE1wJzDndOgvMqpgm2nkvjjznLccBxosbDOLna3CEwUgmeZYByQ0esHVw2DA4Rw+/YDrnd+MQfgyDM/KAkwZSI35HCfg3bOJF6Z7zFt2TeSUrD+thcIXT6iO7IwvpdrWxfJTfz4o8u8pTZXAV+OMsL4tYMJ27365RMcfcpGMUtfa71Krlob1sWiz9bNHOWSdxnJfbMCTrnEvE2NYPEf9v/ZBZWdBdnHOaIZJu/RTQP9Y0Ixy6AS0NSb1d9Iykfa8dsfSzizpnAaW4gKQMS1HKY9+UJBl8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xpsaZZZr+mXSYpqw9vZNaosVxK9fK1C4XM4IQh17DCK6kJqTYoGEwNlQkKqDsqUiV656qH14NOuwwbr3CxEl0TRdtHaWvdVq2sKuUL1BGr3lb/PSu8djK7Wu1OG20tUpFHluFV2j+oSePVonlMTyyVhAKzfk0TUw7NHxnFWmdT+7FM6SUlVZzULzhElt5hx2dQNjw4Oj6wZv+czbxcxlqSeFoI7dGeqbAevxzdkToRYVz4RD3zYM8ffqiM2GH5L4Gf+BMNv9B4V8R0qvsrQw9c6sj5vpSqgmpJzurhTmuCHcfh7te04mP76sd65F1wUYLnHwUHwx9DDlVcPPrze2f/wYSN1/xuLtcbbLFPpFvSUvaPkUwnCvgZRDtesPu62kX3K9P0JEFljaxvhMkbTdiZTc1RtdfQZNqL2vzF577hYWUmeVDhviXdotpeeBo8FbWRn9ijZE+rcLe3/yzo3h7lWXCLPR7/6aNdGiOzxrY2QaSNaG3KnjWFZpts3Oxhm/T4P0kaxbsi67rPeEEPbQRg0ZRC4D7FrDT/UgVD8+Q9UP4wXUP84fZTLgtCYLFCq0+yWfn0CgRCfQmd/eY0XmAr3Nvnqc9KS3obCakWkVaxvY5Bj08mNXWu6oyf8b2p6STvjyTXtH2Vxn7U72vNmhds9qyJbAFDs3YhQKANP1zCBb5Clc47Fh9g/luEbcemccPGhrWdiegy/dM6++NB6pzK2OBaji7N93l09BeMZBHleoy/OrMvWmRow3OJ2z8BptT9/hXjByLxFIfqBFMeGu6o1U3qbN2HDoqhZYiUA55ijBHz5pIDEH8UcPosqqho8r8cYTyF3TKb0ouSLkgPLOLtJjWcWEX2WnV9N8Jg0jy4W1aT2U7AAZBLRK7qgP5UkTRTdZ578pQOFCGt1ui10yUXaPX9UmOQwbh9EtfhUNBY5XgrI2AWdIW2oegBt4IW/4DmKH5smaDeS1YowxT56TdC8QBmrcbT74Vew4SR7ePkPqKvixAU+AAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>