using System;
using System.Collections.Generic;
using ManagerService.Data.SubSection;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ManagerService.Migrations
{
///
public partial class InitialCreate : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Configurations",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Label = table.Column(type: "text", nullable: false),
Title = table.Column>(type: "jsonb", nullable: false),
ImageId = table.Column(type: "text", nullable: true),
ImageSource = table.Column(type: "text", nullable: true),
PrimaryColor = table.Column(type: "text", nullable: true),
SecondaryColor = table.Column(type: "text", nullable: true),
Languages = table.Column>(type: "text[]", nullable: true),
DateCreation = table.Column(type: "timestamp with time zone", nullable: false),
IsMobile = table.Column(type: "boolean", nullable: false),
IsTablet = table.Column(type: "boolean", nullable: false),
IsOffline = table.Column(type: "boolean", nullable: false),
InstanceId = table.Column(type: "text", nullable: false),
LoaderImageId = table.Column(type: "text", nullable: true),
LoaderImageUrl = table.Column(type: "text", nullable: true),
WeatherCity = table.Column(type: "text", nullable: true),
WeatherUpdatedDate = table.Column(type: "timestamp with time zone", nullable: true),
WeatherResult = table.Column(type: "text", nullable: true),
IsDate = table.Column(type: "boolean", nullable: false),
IsHour = table.Column(type: "boolean", nullable: false),
IsSectionImageBackground = table.Column(type: "boolean", nullable: false),
RoundedValue = table.Column(type: "integer", nullable: true),
ScreenPercentageSectionsMainPage = table.Column(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Configurations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Devices",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Identifier = table.Column(type: "text", nullable: true),
Name = table.Column(type: "text", nullable: true),
IpAddressWLAN = table.Column(type: "text", nullable: false),
IpAddressETH = table.Column(type: "text", nullable: false),
Configuration = table.Column(type: "text", nullable: true),
ConfigurationId = table.Column(type: "text", nullable: false),
Connected = table.Column(type: "boolean", nullable: false),
DateCreation = table.Column(type: "timestamp with time zone", nullable: false),
DateUpdate = table.Column(type: "timestamp with time zone", nullable: false),
BatteryLevel = table.Column(type: "text", nullable: true),
LastBatteryLevel = table.Column(type: "timestamp with time zone", nullable: false),
ConnectionLevel = table.Column(type: "text", nullable: true),
LastConnectionLevel = table.Column(type: "timestamp with time zone", nullable: false),
InstanceId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Devices", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Instances",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Name = table.Column(type: "text", nullable: false),
DateCreation = table.Column(type: "timestamp with time zone", nullable: false),
PinCode = table.Column(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Instances", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Resources",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Type = table.Column(type: "integer", nullable: false),
Label = table.Column(type: "text", nullable: false),
DateCreation = table.Column(type: "timestamp with time zone", nullable: false),
InstanceId = table.Column(type: "text", nullable: false),
Url = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Resources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Sections",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Label = table.Column(type: "text", nullable: false),
Title = table.Column>(type: "jsonb", nullable: false),
Description = table.Column>(type: "jsonb", nullable: true),
Order = table.Column(type: "integer", nullable: false),
ConfigurationId = table.Column(type: "text", nullable: false),
ImageId = table.Column(type: "text", nullable: false),
ImageSource = table.Column(type: "text", nullable: false),
Type = table.Column(type: "integer", nullable: false),
IsSubSection = table.Column(type: "boolean", nullable: false),
ParentId = table.Column(type: "text", nullable: true),
DateCreation = table.Column(type: "timestamp with time zone", nullable: false),
Data = table.Column(type: "text", nullable: false),
InstanceId = table.Column(type: "text", nullable: false),
IsBeacon = table.Column(type: "boolean", nullable: false),
BeaconId = table.Column(type: "integer", nullable: true),
Latitude = table.Column(type: "text", nullable: true),
Longitude = table.Column(type: "text", nullable: true),
MeterZoneGPS = table.Column(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Sections", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Email = table.Column(type: "text", nullable: false),
Password = table.Column(type: "text", nullable: false),
FirstName = table.Column(type: "text", nullable: true),
LastName = table.Column(type: "text", nullable: false),
Token = table.Column(type: "text", nullable: false),
DateCreation = table.Column(type: "timestamp with time zone", nullable: false),
InstanceId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Configurations");
migrationBuilder.DropTable(
name: "Devices");
migrationBuilder.DropTable(
name: "Instances");
migrationBuilder.DropTable(
name: "Resources");
migrationBuilder.DropTable(
name: "Sections");
migrationBuilder.DropTable(
name: "Users");
}
}
}