using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Artemis.Storage.Migrations { /// public partial class Initial : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Devices", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), DeviceProvider = table.Column(type: "TEXT", nullable: false), X = table.Column(type: "REAL", nullable: false), Y = table.Column(type: "REAL", nullable: false), Rotation = table.Column(type: "REAL", nullable: false), Scale = table.Column(type: "REAL", nullable: false), ZIndex = table.Column(type: "INTEGER", nullable: false), RedScale = table.Column(type: "REAL", nullable: false), GreenScale = table.Column(type: "REAL", nullable: false), BlueScale = table.Column(type: "REAL", nullable: false), IsEnabled = table.Column(type: "INTEGER", nullable: false), PhysicalLayout = table.Column(type: "INTEGER", nullable: false), LogicalLayout = table.Column(type: "TEXT", nullable: true), LayoutType = table.Column(type: "TEXT", nullable: true), LayoutParameter = table.Column(type: "TEXT", nullable: true), Categories = table.Column(type: "TEXT", nullable: false), InputIdentifiers = table.Column(type: "TEXT", nullable: false), InputMappings = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Devices", x => x.Id); }); migrationBuilder.CreateTable( name: "Entries", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), EntryId = table.Column(type: "INTEGER", nullable: false), EntryType = table.Column(type: "INTEGER", nullable: false), Author = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", nullable: false), ReleaseId = table.Column(type: "INTEGER", nullable: false), ReleaseVersion = table.Column(type: "TEXT", nullable: false), InstalledAt = table.Column(type: "TEXT", nullable: false), Metadata = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Entries", x => x.Id); }); migrationBuilder.CreateTable( name: "Plugins", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), IsEnabled = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Plugins", x => x.Id); }); migrationBuilder.CreateTable( name: "PluginSettings", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), PluginGuid = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", nullable: false), Value = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PluginSettings", x => x.Id); }); migrationBuilder.CreateTable( name: "ProfileCategories", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", nullable: false), IsCollapsed = table.Column(type: "INTEGER", nullable: false), IsSuspended = table.Column(type: "INTEGER", nullable: false), Order = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProfileCategories", x => x.Id); }); migrationBuilder.CreateTable( name: "Releases", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Version = table.Column(type: "TEXT", nullable: false), InstalledAt = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Releases", x => x.Id); }); migrationBuilder.CreateTable( name: "PluginFeatureEntity", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Type = table.Column(type: "TEXT", nullable: false), IsEnabled = table.Column(type: "INTEGER", nullable: false), PluginEntityId = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_PluginFeatureEntity", x => x.Id); table.ForeignKey( name: "FK_PluginFeatureEntity_Plugins_PluginEntityId", column: x => x.PluginEntityId, principalTable: "Plugins", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "ProfileContainerEntity", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Icon = table.Column(type: "BLOB", nullable: false), ProfileCategoryId = table.Column(type: "TEXT", nullable: false), ProfileConfiguration = table.Column(type: "TEXT", nullable: false), Profile = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProfileContainerEntity", x => x.Id); table.ForeignKey( name: "FK_ProfileContainerEntity_ProfileCategories_ProfileCategoryId", column: x => x.ProfileCategoryId, principalTable: "ProfileCategories", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_PluginFeatureEntity_PluginEntityId", table: "PluginFeatureEntity", column: "PluginEntityId"); migrationBuilder.CreateIndex( name: "IX_ProfileContainerEntity_ProfileCategoryId", table: "ProfileContainerEntity", column: "ProfileCategoryId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Devices"); migrationBuilder.DropTable( name: "Entries"); migrationBuilder.DropTable( name: "PluginFeatureEntity"); migrationBuilder.DropTable( name: "PluginSettings"); migrationBuilder.DropTable( name: "ProfileContainerEntity"); migrationBuilder.DropTable( name: "Releases"); migrationBuilder.DropTable( name: "Plugins"); migrationBuilder.DropTable( name: "ProfileCategories"); } } }