fix migrations

This commit is contained in:
pavelbannov 2021-10-26 16:14:40 +03:00
parent b1134d239c
commit cb8bc701ec
45 changed files with 13911 additions and 5343 deletions

View File

@ -3,12 +3,10 @@ using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF.Model
{
[Keyless]
public class Regions
{
public string Region { get; set; }
public string Provider { get; set; }
public string ConnectionString { get; set; }
}

View File

@ -0,0 +1,64 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.AccountLinkContextMySql
{
[DbContext(typeof(MySqlAccountLinkContext))]
[Migration("20211012145324_AccountLinkContextMySql")]
partial class AccountLinkContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.AccountLinks", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(200)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UId")
.HasColumnType("varchar(200)")
.HasColumnName("uid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Linked")
.HasColumnType("datetime")
.HasColumnName("linked");
b.Property<string>("Profile")
.IsRequired()
.HasColumnType("text")
.HasColumnName("profile")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Provider")
.HasColumnType("char(60)")
.HasColumnName("provider")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id", "UId")
.HasName("PRIMARY");
b.HasIndex("UId")
.HasDatabaseName("uid");
b.ToTable("account_links");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,45 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.AccountLinkContextMySql
{
public partial class AccountLinkContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "account_links",
columns: table => new
{
id = table.Column<string>(type: "varchar(200)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
uid = table.Column<string>(type: "varchar(200)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
provider = table.Column<string>(type: "char(60)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
profile = table.Column<string>(type: "text", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
linked = table.Column<DateTime>(type: "datetime", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.id, x.uid });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "uid",
table: "account_links",
column: "uid");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "account_links");
}
}
}

View File

@ -15,7 +15,7 @@ namespace ASC.Core.Common.Migrations.MySql.AccountLinkContextMySql
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
.HasAnnotation("ProductVersion", "5.0.8");
modelBuilder.Entity("ASC.Core.Common.EF.Model.AccountLinks", b =>
{

View File

@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using ASC.Core.Common.EF;
using Microsoft.EntityFrameworkCore;
@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
{
[DbContext(typeof(MySqlCoreDbContext))]
[Migration("20210803211311_CoreDbContextMySql")]
[Migration("20211012145320_CoreDbContextMySql")]
partial class CoreDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -29,14 +29,14 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
.HasColumnType("varchar(50)")
.HasColumnName("partner_id")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ButtonUrl")
.IsRequired()
.HasColumnType("text")
.HasColumnName("button_url")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TariffId", "PartnerId")
.HasName("PRIMARY");
@ -59,19 +59,19 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
.HasColumnType("varchar(128)")
.HasColumnName("avangate_id")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Description")
.HasColumnType("varchar(128)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Features")
.HasColumnType("text")
.HasColumnName("features")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<long>("MaxFileSize")
.HasColumnType("bigint")
@ -85,16 +85,12 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
.HasColumnType("varchar(128)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<decimal>("Price")
.HasColumnType("decimal(10,2)")
.HasColumnName("price");
b.Property<decimal>("Price2")
.HasColumnType("decimal(10,2)")
.HasColumnName("price2");
b.Property<bool>("Visible")
.HasColumnType("tinyint(1)")
.HasColumnName("visible");
@ -115,7 +111,6 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
MaxTotalSize = 10995116277760L,
Name = "default",
Price = 0.00m,
Price2 = 0.00m,
Visible = false
});
});
@ -130,7 +125,7 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
.HasColumnType("varchar(255)")
.HasColumnName("path")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<long>("Counter")
.HasColumnType("bigint")
@ -146,7 +141,7 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
.HasColumnType("varchar(1024)")
.HasColumnName("tag")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Tenant", "Path")
.HasName("PRIMARY");
@ -168,7 +163,7 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
.HasColumnType("varchar(255)")
.HasColumnName("comment")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreateOn")
.ValueGeneratedOnAddOrUpdate()

View File

@ -1,4 +1,5 @@
using System;
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
@ -43,7 +44,6 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
features = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
price = table.Column<decimal>(type: "decimal(10,2)", nullable: false),
price2 = table.Column<decimal>(type: "decimal(10,2)", nullable: false),
avangate_id = table.Column<string>(type: "varchar(128)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
visible = table.Column<bool>(type: "tinyint(1)", nullable: false)
@ -94,8 +94,8 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
migrationBuilder.InsertData(
table: "tenants_quota",
columns: new[] { "tenant", "active_users", "avangate_id", "description", "features", "max_file_size", "max_total_size", "name", "price", "price2", "visible" },
values: new object[] { -1, 10000, "0", null, "domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom,restore", 102400L, 10995116277760L, "default", 0.00m, 0.00m, false });
columns: new[] { "tenant", "active_users", "avangate_id", "description", "features", "max_file_size", "max_total_size", "name", "price", "visible" },
values: new object[] { -1, 10000, "0", null, "domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom,restore", 102400L, 10995116277760L, "default", 0.00m, false });
migrationBuilder.CreateIndex(
name: "last_modified",
@ -110,6 +110,9 @@ namespace ASC.Core.Common.Migrations.MySql.CoreDbContextMySql
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "core_acl");
migrationBuilder.DropTable(
name: "tenants_buttons");

View File

@ -0,0 +1,161 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.DbContextMySql
{
[DbContext(typeof(MySqlDbContext))]
[Migration("20211012145326_DbContextMySql")]
partial class DbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbipLocation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("AddrType")
.IsRequired()
.HasColumnType("enum('ipv4','ipv6')")
.HasColumnName("addr_type")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("City")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("city")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Country")
.IsRequired()
.HasColumnType("varchar(2)")
.HasColumnName("country")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("District")
.HasColumnType("varchar(255)")
.HasColumnName("district")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("GeonameId")
.HasColumnType("int")
.HasColumnName("geoname_id");
b.Property<string>("IPEnd")
.IsRequired()
.HasColumnType("varchar(39)")
.HasColumnName("ip_end")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("IPStart")
.IsRequired()
.HasColumnType("varchar(39)")
.HasColumnName("ip_start")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<long>("Latitude")
.HasColumnType("bigint")
.HasColumnName("latitude");
b.Property<long>("Longitude")
.HasColumnType("bigint")
.HasColumnName("longitude");
b.Property<int>("Processed")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("processed")
.HasDefaultValueSql("'1'");
b.Property<string>("StateProv")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("stateprov")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TimezoneName")
.HasColumnType("varchar(255)")
.HasColumnName("timezone_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<double>("TimezoneOffset")
.HasColumnType("double")
.HasColumnName("timezone_offset");
b.Property<string>("ZipCode")
.HasColumnType("varchar(255)")
.HasColumnName("zipcode")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("IPStart")
.HasDatabaseName("ip_start");
b.ToTable("dbip_location");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.MobileAppInstall", b =>
{
b.Property<string>("UserEmail")
.HasColumnType("varchar(255)")
.HasColumnName("user_email")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("AppType")
.HasColumnType("int")
.HasColumnName("app_type");
b.Property<DateTime>("LastSign")
.HasColumnType("datetime")
.HasColumnName("last_sign");
b.Property<DateTime>("RegisteredOn")
.HasColumnType("datetime")
.HasColumnName("registered_on");
b.HasKey("UserEmail", "AppType")
.HasName("PRIMARY");
b.ToTable("mobile_app_install");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Regions", b =>
{
b.Property<string>("ConnectionString")
.HasColumnType("longtext");
b.Property<string>("Provider")
.HasColumnType("longtext");
b.Property<string>("Region")
.HasColumnType("longtext");
b.ToTable("Regions");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,102 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.DbContextMySql
{
public partial class DbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "dbip_location",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
addr_type = table.Column<string>(type: "enum('ipv4','ipv6')", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
ip_start = table.Column<string>(type: "varchar(39)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
ip_end = table.Column<string>(type: "varchar(39)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
country = table.Column<string>(type: "varchar(2)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
stateprov = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
district = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
city = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
zipcode = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
latitude = table.Column<long>(type: "bigint", nullable: false),
longitude = table.Column<long>(type: "bigint", nullable: false),
geoname_id = table.Column<int>(type: "int", nullable: false),
timezone_offset = table.Column<double>(type: "double", nullable: false),
timezone_name = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
processed = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'1'")
},
constraints: table =>
{
table.PrimaryKey("PK_dbip_location", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "mobile_app_install",
columns: table => new
{
user_email = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
app_type = table.Column<int>(type: "int", nullable: false),
registered_on = table.Column<DateTime>(type: "datetime", nullable: false),
last_sign = table.Column<DateTime>(type: "datetime", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.user_email, x.app_type });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Regions",
columns: table => new
{
Region = table.Column<string>(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Provider = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConnectionString = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Regions", x => x.Region);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "ip_start",
table: "dbip_location",
column: "ip_start");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "dbip_location");
migrationBuilder.DropTable(
name: "mobile_app_install");
migrationBuilder.DropTable(
name: "Regions");
}
}
}

View File

@ -140,22 +140,21 @@ namespace ASC.Core.Common.Migrations.MySql.DbContextMySql
b.ToTable("mobile_app_install");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Regions", b =>
{
b.Property<string>("Region")
.HasColumnType("varchar(255)");
b.Property<string>("ConnectionString")
.HasColumnType("longtext");
b.Property<string>("Provider")
.HasColumnType("longtext");
b.Property<string>("Region")
.HasColumnType("longtext");
b.ToTable("Regions");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Regions", b =>
{
b.Property<string>("Region")
.HasColumnType("varchar(255)");
b.Property<string>("ConnectionString")
.HasColumnType("longtext");
b.Property<string>("Provider")
.HasColumnType("longtext");
b.HasKey("Region");
b.ToTable("Regions");
});
#pragma warning restore 612, 618
}
}

View File

@ -0,0 +1,178 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.FeedDbContextMySql
{
[DbContext(typeof(MySqlFeedDbContext))]
[Migration("20211012145328_FeedDbContextMySql")]
partial class FeedDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.FeedAggregate", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(88)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("AggregateDate")
.HasColumnType("datetime")
.HasColumnName("aggregated_date");
b.Property<string>("Author")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("author")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreatedDate")
.HasColumnType("datetime")
.HasColumnName("created_date");
b.Property<string>("GroupId")
.HasColumnType("varchar(70)")
.HasColumnName("group_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Json")
.IsRequired()
.HasColumnType("mediumtext")
.HasColumnName("json")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Keywords")
.HasColumnType("text")
.HasColumnName("keywords")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("modified_by")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("ModifiedDate")
.HasColumnType("datetime")
.HasColumnName("modified_date");
b.Property<string>("Module")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("module")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Product")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("product")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("Id");
b.HasIndex("Tenant", "AggregateDate")
.HasDatabaseName("aggregated_date");
b.HasIndex("Tenant", "ModifiedDate")
.HasDatabaseName("modified_date");
b.HasIndex("Tenant", "Product")
.HasDatabaseName("product");
b.ToTable("feed_aggregate");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.FeedLast", b =>
{
b.Property<string>("LastKey")
.HasColumnType("varchar(128)")
.HasColumnName("last_key")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastDate")
.HasColumnType("datetime")
.HasColumnName("last_date");
b.HasKey("LastKey")
.HasName("PRIMARY");
b.ToTable("feed_last");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.FeedReaded", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.HasColumnType("varchar(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Module")
.HasColumnType("varchar(50)")
.HasColumnName("module")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("TimeStamp")
.HasColumnType("datetime")
.HasColumnName("timestamp");
b.HasKey("Tenant", "UserId", "Module")
.HasName("PRIMARY");
b.ToTable("feed_readed");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.FeedUsers", b =>
{
b.Property<string>("FeedId")
.HasColumnType("varchar(88)")
.HasColumnName("feed_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("FeedId", "UserId")
.HasName("PRIMARY");
b.HasIndex("UserId")
.HasDatabaseName("user_id");
b.ToTable("feed_users");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,126 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.FeedDbContextMySql
{
public partial class FeedDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "feed_aggregate",
columns: table => new
{
id = table.Column<string>(type: "varchar(88)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
tenant = table.Column<int>(type: "int", nullable: false),
product = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
module = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
author = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
modified_by = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
created_date = table.Column<DateTime>(type: "datetime", nullable: false),
modified_date = table.Column<DateTime>(type: "datetime", nullable: false),
group_id = table.Column<string>(type: "varchar(70)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
aggregated_date = table.Column<DateTime>(type: "datetime", nullable: false),
json = table.Column<string>(type: "mediumtext", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
keywords = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PK_feed_aggregate", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "feed_last",
columns: table => new
{
last_key = table.Column<string>(type: "varchar(128)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
last_date = table.Column<DateTime>(type: "datetime", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.last_key);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "feed_readed",
columns: table => new
{
user_id = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
module = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
tenant_id = table.Column<int>(type: "int", nullable: false),
timestamp = table.Column<DateTime>(type: "datetime", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenant_id, x.user_id, x.module });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "feed_users",
columns: table => new
{
feed_id = table.Column<string>(type: "varchar(88)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
user_id = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.feed_id, x.user_id });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "aggregated_date",
table: "feed_aggregate",
columns: new[] { "tenant", "aggregated_date" });
migrationBuilder.CreateIndex(
name: "modified_date",
table: "feed_aggregate",
columns: new[] { "tenant", "modified_date" });
migrationBuilder.CreateIndex(
name: "product",
table: "feed_aggregate",
columns: new[] { "tenant", "product" });
migrationBuilder.CreateIndex(
name: "user_id",
table: "feed_users",
column: "user_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "feed_aggregate");
migrationBuilder.DropTable(
name: "feed_last");
migrationBuilder.DropTable(
name: "feed_readed");
migrationBuilder.DropTable(
name: "feed_users");
}
}
}

View File

@ -0,0 +1,785 @@
// <auto-generated />
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.FilesDbContextMySql
{
[DbContext(typeof(MySqlFilesDbContext))]
[Migration("20211012145330_FilesDbContextMySql")]
partial class FilesDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.FilesConverts", b =>
{
b.Property<string>("Input")
.HasColumnType("varchar(50)")
.HasColumnName("input")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Output")
.HasColumnType("varchar(50)")
.HasColumnName("output")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Input", "Output")
.HasName("PRIMARY");
b.ToTable("files_converts");
b.HasData(
new
{
Input = ".csv",
Output = ".ods"
},
new
{
Input = ".csv",
Output = ".pdf"
},
new
{
Input = ".csv",
Output = ".xlsx"
},
new
{
Input = ".doc",
Output = ".docx"
},
new
{
Input = ".doc",
Output = ".odt"
},
new
{
Input = ".doc",
Output = ".pdf"
},
new
{
Input = ".doc",
Output = ".rtf"
},
new
{
Input = ".doc",
Output = ".txt"
},
new
{
Input = ".docm",
Output = ".docx"
},
new
{
Input = ".docm",
Output = ".odt"
},
new
{
Input = ".docm",
Output = ".pdf"
},
new
{
Input = ".docm",
Output = ".rtf"
},
new
{
Input = ".docm",
Output = ".txt"
},
new
{
Input = ".doct",
Output = ".docx"
},
new
{
Input = ".docx",
Output = ".odt"
},
new
{
Input = ".docx",
Output = ".pdf"
},
new
{
Input = ".docx",
Output = ".rtf"
},
new
{
Input = ".docx",
Output = ".txt"
},
new
{
Input = ".dot",
Output = ".docx"
},
new
{
Input = ".dot",
Output = ".odt"
},
new
{
Input = ".dot",
Output = ".pdf"
},
new
{
Input = ".dot",
Output = ".rtf"
},
new
{
Input = ".dot",
Output = ".txt"
},
new
{
Input = ".dotm",
Output = ".docx"
},
new
{
Input = ".dotm",
Output = ".odt"
},
new
{
Input = ".dotm",
Output = ".pdf"
},
new
{
Input = ".dotm",
Output = ".rtf"
},
new
{
Input = ".dotm",
Output = ".txt"
},
new
{
Input = ".dotx",
Output = ".docx"
},
new
{
Input = ".dotx",
Output = ".odt"
},
new
{
Input = ".dotx",
Output = ".pdf"
},
new
{
Input = ".dotx",
Output = ".rtf"
},
new
{
Input = ".dotx",
Output = ".txt"
},
new
{
Input = ".epub",
Output = ".docx"
},
new
{
Input = ".epub",
Output = ".odt"
},
new
{
Input = ".epub",
Output = ".pdf"
},
new
{
Input = ".epub",
Output = ".rtf"
},
new
{
Input = ".epub",
Output = ".txt"
},
new
{
Input = ".fb2",
Output = ".docx"
},
new
{
Input = ".fb2",
Output = ".odt"
},
new
{
Input = ".fb2",
Output = ".pdf"
},
new
{
Input = ".fb2",
Output = ".rtf"
},
new
{
Input = ".fb2",
Output = ".txt"
},
new
{
Input = ".fodp",
Output = ".odp"
},
new
{
Input = ".fodp",
Output = ".pdf"
},
new
{
Input = ".fodp",
Output = ".pptx"
},
new
{
Input = ".fods",
Output = ".csv"
},
new
{
Input = ".fods",
Output = ".ods"
},
new
{
Input = ".fods",
Output = ".pdf"
},
new
{
Input = ".fods",
Output = ".xlsx"
},
new
{
Input = ".fodt",
Output = ".docx"
},
new
{
Input = ".fodt",
Output = ".odt"
},
new
{
Input = ".fodt",
Output = ".pdf"
},
new
{
Input = ".fodt",
Output = ".rtf"
},
new
{
Input = ".fodt",
Output = ".txt"
},
new
{
Input = ".html",
Output = ".docx"
},
new
{
Input = ".html",
Output = ".odt"
},
new
{
Input = ".html",
Output = ".pdf"
},
new
{
Input = ".html",
Output = ".rtf"
},
new
{
Input = ".html",
Output = ".txt"
},
new
{
Input = ".mht",
Output = ".docx"
},
new
{
Input = ".mht",
Output = ".odt"
},
new
{
Input = ".mht",
Output = ".pdf"
},
new
{
Input = ".mht",
Output = ".rtf"
},
new
{
Input = ".mht",
Output = ".txt"
},
new
{
Input = ".odp",
Output = ".pdf"
},
new
{
Input = ".odp",
Output = ".pptx"
},
new
{
Input = ".otp",
Output = ".odp"
},
new
{
Input = ".otp",
Output = ".pdf"
},
new
{
Input = ".otp",
Output = ".pptx"
},
new
{
Input = ".ods",
Output = ".csv"
},
new
{
Input = ".ods",
Output = ".pdf"
},
new
{
Input = ".ods",
Output = ".xlsx"
},
new
{
Input = ".ots",
Output = ".csv"
},
new
{
Input = ".ots",
Output = ".ods"
},
new
{
Input = ".ots",
Output = ".pdf"
},
new
{
Input = ".ots",
Output = ".xlsx"
},
new
{
Input = ".odt",
Output = ".docx"
},
new
{
Input = ".odt",
Output = ".pdf"
},
new
{
Input = ".odt",
Output = ".rtf"
},
new
{
Input = ".odt",
Output = ".txt"
},
new
{
Input = ".ott",
Output = ".docx"
},
new
{
Input = ".ott",
Output = ".odt"
},
new
{
Input = ".ott",
Output = ".pdf"
},
new
{
Input = ".ott",
Output = ".rtf"
},
new
{
Input = ".ott",
Output = ".txt"
},
new
{
Input = ".pot",
Output = ".odp"
},
new
{
Input = ".pot",
Output = ".pdf"
},
new
{
Input = ".pot",
Output = ".pptx"
},
new
{
Input = ".potm",
Output = ".odp"
},
new
{
Input = ".potm",
Output = ".pdf"
},
new
{
Input = ".potm",
Output = ".pptx"
},
new
{
Input = ".potx",
Output = ".odp"
},
new
{
Input = ".potx",
Output = ".pdf"
},
new
{
Input = ".potx",
Output = ".pptx"
},
new
{
Input = ".pps",
Output = ".odp"
},
new
{
Input = ".pps",
Output = ".pdf"
},
new
{
Input = ".pps",
Output = ".pptx"
},
new
{
Input = ".ppsm",
Output = ".odp"
},
new
{
Input = ".ppsm",
Output = ".pdf"
},
new
{
Input = ".ppsm",
Output = ".pptx"
},
new
{
Input = ".ppsx",
Output = ".odp"
},
new
{
Input = ".ppsx",
Output = ".pdf"
},
new
{
Input = ".ppsx",
Output = ".pptx"
},
new
{
Input = ".ppt",
Output = ".odp"
},
new
{
Input = ".ppt",
Output = ".pdf"
},
new
{
Input = ".ppt",
Output = ".pptx"
},
new
{
Input = ".pptm",
Output = ".odp"
},
new
{
Input = ".pptm",
Output = ".pdf"
},
new
{
Input = ".pptm",
Output = ".pptx"
},
new
{
Input = ".pptt",
Output = ".odp"
},
new
{
Input = ".pptt",
Output = ".pdf"
},
new
{
Input = ".pptt",
Output = ".pptx"
},
new
{
Input = ".pptx",
Output = ".odp"
},
new
{
Input = ".pptx",
Output = ".pdf"
},
new
{
Input = ".rtf",
Output = ".odp"
},
new
{
Input = ".rtf",
Output = ".pdf"
},
new
{
Input = ".rtf",
Output = ".docx"
},
new
{
Input = ".rtf",
Output = ".txt"
},
new
{
Input = ".txt",
Output = ".pdf"
},
new
{
Input = ".txt",
Output = ".docx"
},
new
{
Input = ".txt",
Output = ".odp"
},
new
{
Input = ".txt",
Output = ".rtx"
},
new
{
Input = ".xls",
Output = ".csv"
},
new
{
Input = ".xls",
Output = ".ods"
},
new
{
Input = ".xls",
Output = ".pdf"
},
new
{
Input = ".xls",
Output = ".xlsx"
},
new
{
Input = ".xlsm",
Output = ".csv"
},
new
{
Input = ".xlsm",
Output = ".pdf"
},
new
{
Input = ".xlsm",
Output = ".ods"
},
new
{
Input = ".xlsm",
Output = ".xlsx"
},
new
{
Input = ".xlst",
Output = ".pdf"
},
new
{
Input = ".xlst",
Output = ".xlsx"
},
new
{
Input = ".xlst",
Output = ".csv"
},
new
{
Input = ".xlst",
Output = ".ods"
},
new
{
Input = ".xlt",
Output = ".csv"
},
new
{
Input = ".xlt",
Output = ".ods"
},
new
{
Input = ".xlt",
Output = ".pdf"
},
new
{
Input = ".xlt",
Output = ".xlsx"
},
new
{
Input = ".xltm",
Output = ".csv"
},
new
{
Input = ".xltm",
Output = ".ods"
},
new
{
Input = ".xltm",
Output = ".pdf"
},
new
{
Input = ".xltm",
Output = ".xlsx"
},
new
{
Input = ".xltx",
Output = ".pdf"
},
new
{
Input = ".xltx",
Output = ".csv"
},
new
{
Input = ".xltx",
Output = ".ods"
},
new
{
Input = ".xltx",
Output = ".xlsx"
},
new
{
Input = ".xps",
Output = ".pdf"
});
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,189 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.FilesDbContextMySql
{
public partial class FilesDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_converts",
columns: table => new
{
input = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
output = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.input, x.output });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "files_converts",
columns: new[] { "input", "output" },
values: new object[,]
{
{ ".csv", ".ods" },
{ ".pps", ".odp" },
{ ".pps", ".pdf" },
{ ".pps", ".pptx" },
{ ".ppsm", ".odp" },
{ ".ppsm", ".pdf" },
{ ".ppsm", ".pptx" },
{ ".potx", ".pptx" },
{ ".ppsx", ".odp" },
{ ".ppsx", ".pptx" },
{ ".ppt", ".odp" },
{ ".ppt", ".pdf" },
{ ".ppt", ".pptx" },
{ ".pptm", ".odp" },
{ ".pptm", ".pdf" },
{ ".ppsx", ".pdf" },
{ ".potx", ".pdf" },
{ ".potx", ".odp" },
{ ".potm", ".pptx" },
{ ".ots", ".xlsx" },
{ ".odt", ".docx" },
{ ".odt", ".pdf" },
{ ".odt", ".rtf" },
{ ".odt", ".txt" },
{ ".ott", ".docx" },
{ ".ott", ".odt" },
{ ".ott", ".pdf" },
{ ".ott", ".rtf" },
{ ".ott", ".txt" },
{ ".pot", ".odp" },
{ ".pot", ".pdf" },
{ ".pot", ".pptx" },
{ ".potm", ".odp" },
{ ".potm", ".pdf" },
{ ".pptm", ".pptx" },
{ ".ots", ".pdf" },
{ ".pptt", ".odp" },
{ ".pptt", ".pptx" },
{ ".xlst", ".xlsx" },
{ ".xlst", ".csv" },
{ ".xlst", ".ods" },
{ ".xlt", ".csv" },
{ ".xlt", ".ods" },
{ ".xlt", ".pdf" },
{ ".xlst", ".pdf" },
{ ".xlt", ".xlsx" },
{ ".xltm", ".ods" },
{ ".xltm", ".pdf" },
{ ".xltm", ".xlsx" },
{ ".xltx", ".pdf" },
{ ".xltx", ".csv" },
{ ".xltx", ".ods" },
{ ".xltm", ".csv" },
{ ".xlsm", ".xlsx" },
{ ".xlsm", ".ods" },
{ ".xlsm", ".pdf" },
{ ".pptx", ".odp" },
{ ".pptx", ".pdf" },
{ ".rtf", ".odp" },
{ ".rtf", ".pdf" },
{ ".rtf", ".docx" },
{ ".rtf", ".txt" },
{ ".txt", ".pdf" },
{ ".txt", ".docx" },
{ ".txt", ".odp" },
{ ".txt", ".rtx" },
{ ".xls", ".csv" },
{ ".xls", ".ods" },
{ ".xls", ".pdf" },
{ ".xls", ".xlsx" },
{ ".xlsm", ".csv" },
{ ".pptt", ".pdf" },
{ ".ots", ".ods" },
{ ".ots", ".csv" },
{ ".ods", ".xlsx" },
{ ".dot", ".pdf" },
{ ".dot", ".rtf" },
{ ".dot", ".txt" },
{ ".dotm", ".docx" },
{ ".dotm", ".odt" },
{ ".dotm", ".pdf" },
{ ".dot", ".odt" },
{ ".dotm", ".rtf" },
{ ".dotx", ".docx" },
{ ".dotx", ".odt" },
{ ".dotx", ".pdf" },
{ ".dotx", ".rtf" },
{ ".dotx", ".txt" },
{ ".epub", ".docx" },
{ ".dotm", ".txt" },
{ ".dot", ".docx" },
{ ".docx", ".txt" },
{ ".docx", ".rtf" },
{ ".csv", ".pdf" },
{ ".csv", ".xlsx" },
{ ".doc", ".docx" },
{ ".doc", ".odt" },
{ ".doc", ".pdf" },
{ ".doc", ".rtf" },
{ ".doc", ".txt" },
{ ".docm", ".docx" },
{ ".docm", ".odt" },
{ ".docm", ".pdf" },
{ ".docm", ".rtf" },
{ ".docm", ".txt" },
{ ".doct", ".docx" },
{ ".docx", ".odt" },
{ ".docx", ".pdf" },
{ ".epub", ".odt" },
{ ".epub", ".pdf" },
{ ".epub", ".rtf" },
{ ".epub", ".txt" },
{ ".html", ".pdf" },
{ ".html", ".rtf" },
{ ".html", ".txt" },
{ ".mht", ".docx" },
{ ".mht", ".odt" },
{ ".mht", ".pdf" },
{ ".mht", ".rtf" },
{ ".mht", ".txt" },
{ ".odp", ".pdf" },
{ ".odp", ".pptx" },
{ ".otp", ".odp" },
{ ".otp", ".pdf" },
{ ".otp", ".pptx" },
{ ".ods", ".csv" },
{ ".ods", ".pdf" },
{ ".html", ".odt" },
{ ".xltx", ".xlsx" },
{ ".html", ".docx" },
{ ".fodt", ".rtf" },
{ ".fb2", ".docx" },
{ ".fb2", ".odt" },
{ ".fb2", ".pdf" },
{ ".fb2", ".rtf" },
{ ".fb2", ".txt" },
{ ".fodp", ".odp" },
{ ".fodp", ".pdf" },
{ ".fodp", ".pptx" },
{ ".fods", ".csv" },
{ ".fods", ".ods" },
{ ".fods", ".pdf" },
{ ".fods", ".xlsx" },
{ ".fodt", ".docx" },
{ ".fodt", ".odt" },
{ ".fodt", ".pdf" },
{ ".fodt", ".txt" },
{ ".xps", ".pdf" }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "files_converts");
}
}
}

View File

@ -0,0 +1,443 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.MailDbContextMySql
{
public partial class MailDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ApiKeys",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AccessToken = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ApiKeys", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "GreyListingWhiteList",
columns: table => new
{
Comment = table.Column<string>(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Source = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_GreyListingWhiteList", x => x.Comment);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "mail_mailbox",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
tenant = table.Column<int>(type: "int", nullable: false),
id_user = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
address = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
name = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
enabled = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValueSql: "'1'"),
is_removed = table.Column<bool>(type: "tinyint(1)", nullable: false),
is_processed = table.Column<bool>(type: "tinyint(1)", nullable: false),
is_server_mailbox = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsTeamlabMailbox = table.Column<bool>(type: "tinyint(1)", nullable: false),
imap = table.Column<bool>(type: "tinyint(1)", nullable: false),
user_online = table.Column<bool>(type: "tinyint(1)", nullable: false),
is_default = table.Column<bool>(type: "tinyint(1)", nullable: false),
msg_count_last = table.Column<int>(type: "int", nullable: false),
size_last = table.Column<int>(type: "int", nullable: false),
login_delay = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'30'"),
quota_error = table.Column<bool>(type: "tinyint(1)", nullable: false),
imap_intervals = table.Column<string>(type: "mediumtext", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
begin_date = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "'1975-01-01 00:00:00'"),
email_in_folder = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
pop3_password = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
smtp_password = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
token_type = table.Column<int>(type: "int", nullable: false),
token = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
id_smtp_server = table.Column<int>(type: "int", nullable: false),
id_in_server = table.Column<int>(type: "int", nullable: false),
date_checked = table.Column<DateTime>(type: "datetime", nullable: false),
date_user_checked = table.Column<DateTime>(type: "datetime", nullable: false),
date_login_delay_expires = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "'1975-01-01 00:00:00'"),
date_auth_error = table.Column<DateTime>(type: "datetime", nullable: true),
date_created = table.Column<DateTime>(type: "datetime", nullable: false),
date_modified = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP")
},
constraints: table =>
{
table.PrimaryKey("PK_mail_mailbox", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "mail_mailbox_provider",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
name = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
display_name = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
display_short_name = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
documentation = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PK_mail_mailbox_provider", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "mail_server_server",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
mx_record = table.Column<string>(type: "varchar(128)", nullable: false, defaultValueSql: "''", collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
connection_string = table.Column<string>(type: "text", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
server_type = table.Column<int>(type: "int", nullable: false),
smtp_settings_id = table.Column<int>(type: "int", nullable: false),
imap_settings_id = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_mail_server_server", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "MailboxServer",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
IdProvider = table.Column<int>(type: "int", nullable: false),
Type = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Hostname = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Port = table.Column<int>(type: "int", nullable: false),
SocketType = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Authentication = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsUserData = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MailboxServer", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "mail_mailbox_provider",
columns: new[] { "id", "display_name", "display_short_name", "documentation", "name" },
values: new object[,]
{
{ 1, "1&1", "1&1", "http://hilfe-center.1und1.de/access/search/go.php?t=e698123", "1und1.de" },
{ 141, "??????????", "INET-SHIBATA", null, "pop.shibata.ne.jp" },
{ 142, "Posteo", "Posteo", null, "posteo.de" },
{ 143, "???", "???", null, "purple.plala.or.jp" },
{ 144, "qip.ru", "qip.ru", null, "qip.ru" },
{ 145, "???", "???", null, "rainbow.plala.or.jp" },
{ 146, "Rambler Mail", "Rambler", null, "rambler.ru" },
{ 147, "???", "???", null, "red.plala.or.jp" },
{ 148, "???", "???", null, "rmail.plala.or.jp" },
{ 149, "???", "???", null, "rondo.plala.or.jp" },
{ 150, "???", "???", null, "rose.plala.or.jp" },
{ 151, "???", "???", null, "rouge.plala.or.jp" },
{ 152, "RoadRunner", "RR", "http://help.rr.com/HMSFaqs/e_emailserveraddys.aspx", "rr.com" },
{ 153, "???", "???", null, "ruby.plala.or.jp" },
{ 154, "?????????", "Saku-Net", null, "sakunet.ne.jp" },
{ 155, "???", "???", null, "sea.plala.or.jp" },
{ 156, "???", "???", null, "sepia.plala.or.jp" },
{ 157, "???", "???", null, "serenade.plala.or.jp" },
{ 158, "Seznam", "Seznam", "http://napoveda.seznam.cz/cz/jake-jsou-adresy-pop3-a-smtp-serveru.html", "seznam.cz" },
{ 159, "SFR / Neuf", "SFR", "http://assistance.sfr.fr/internet_neufbox-de-SFR/utiliser-email/parametrer-id-sfr/fc-505-50680", "sfr.fr" },
{ 160, "???", "???", null, "silk.plala.or.jp" },
{ 161, "???", "???", null, "silver.plala.or.jp" },
{ 162, "???", "???", null, "sky.plala.or.jp" },
{ 163, "skynet", "skynet", "http://support.en.belgacom.be/app/answers/detail/a_id/14337/kw/thunderbird", "skynet.be" },
{ 140, "???", "???", null, "polka.plala.or.jp" },
{ 139, "'?????????", "wind", null, "po.wind.ne.jp" },
{ 138, "DCN???????????", "DCN", null, "po.dcn.ne.jp" },
{ 137, "???", "???", null, "plum.plala.or.jp" },
{ 113, "Apple iCloud", "Apple", null, "me.com" },
{ 114, "???", "???", null, "minuet.plala.or.jp" },
{ 115, "???????????", "IWAFUNE", null, "ml.murakami.ne.jp" },
{ 116, "Mnet ??? ????", "Mnet???", null, "mnet.ne.jp" },
{ 117, "mopera U", "mopera U", null, "'mopera.net" },
{ 118, "Mozilla Corporation and Mozilla Foundation internal email addresses", "mozilla.com", null, "mozilla.com" },
{ 119, "TikiTiki???????", "TikiTiki", null, "mx1.tiki.ne.jp" },
{ 120, "???", "???", null, "navy.plala.or.jp" },
{ 121, "nctsoft", "nct", null, "nctsoft.com" },
{ 122, "@nifty", "@nifty", null, "nifty.com" },
{ 123, "BB????", "NSAT", null, "nsat.jp" },
{ 164, "???", "???", null, "smail.plala.or.jp" },
{ 124, "o2 Poczta", "o2", null, "o2.pl" },
{ 126, "Poczta Onet", "Onet", null, "onet.pl" },
{ 127, "???", "???", null, "opal.plala.or.jp" },
{ 128, "???", "???", null, "orange.plala.or.jp" },
{ 129, "???", "???", null, "orchid.plala.or.jp" },
{ 130, "OVH", "OVH", "http://guides.ovh.com/ConfigurationEmail", "ovh.net" },
{ 131, "????FTTH", "????FTTH", null, "pal.kijimadaira.jp" },
{ 132, "???", "???", null, "palette.plala.or.jp" },
{ 133, "??????", "PARABOX", null, "parabox.or.jp" },
{ 134, "Portland State University Mail", "PSU Mail", null, "pdx.edu" },
{ 135, "???", "???", null, "peach.plala.or.jp" },
{ 136, "PeoplePC", "PeoplePC", null, "peoplepc.com" },
{ 125, "???", "???", null, "olive.plala.or.jp" },
{ 112, "???", "???", null, "maroon.plala.or.jp" },
{ 165, "???", "???", null, "snow.plala.or.jp" },
{ 167, "???", "???", null, "sonata.plala.or.jp" },
{ 196, "Your WildWest domain", "WildWest", null, "wildwestdomains.com" },
{ 197, "???", "???", null, "wine.plala.or.jp" },
{ 198, "???", "???", null, "wmail.plala.or.jp" },
{ 199, "Poczta Wirtualna Polska", "Poczta WP", null, "wp.pl" },
{ 200, "???", "???", null, "xmail.plala.or.jp" },
{ 201, "?????????", "wind", null, "xp.wind.jp" },
{ 202, "???", "???", null, "xpost.plala.or.jp" },
{ 203, "XS4All", "XS4All", null, "xs4all.nl" },
{ 204, "Yahoo! Mail", "Yahoo", null, "xtra.co.nz" },
{ 205, "Yahoo! ???", "Yahoo! ??? ", null, "yahoo.co.jp" },
{ 206, "Yahoo! Mail", "Yahoo", null, "yahoo.com" },
{ 207, "Yandex Mail", "Yandex", null, "yandex.ru" },
{ 208, "Yahoo! BB", "Yahoo! BB", null, "ybb.ne.jp" },
{ 209, "???", "???", null, "yellow.plala.or.jp" },
{ 210, "???", "???", null, "ymail.plala.or.jp" },
{ 211, "???", "???", null, "ypost.plala.or.jp" },
{ 212, "Ziggo", "Ziggo", null, "ziggo.nl" },
{ 213, "???", "???", null, "zmail.plala.or.jp" },
{ 214, "???", "???", null, "zpost.plala.or.jp" },
{ 215, "avsmedia.com", "avsmedia", null, "avsmedia.com" },
{ 216, "avsmedia.net", "avsmedia", null, "avsmedia.net" },
{ 218, "ilearney.com", "ilearney.com", null, "ilearney.com" },
{ 219, "fpl-technology.com", "fpl-technology.com", "http://fpl-technology.com", "fpl -technology.com" },
{ 195, "???", "???", null, "white.plala.or.jp" },
{ 194, "WEB.DE Freemail", "Web.de", "http://hilfe.freemail.web.de/freemail/e-mail/pop3/thunderbird/", "web.de" },
{ 193, "???", "???", null, "wave.plala.or.jp" },
{ 192, "???", "???", null, "waltz.plala.or.jp" },
{ 168, "Strato", "Strato", null, "strato.de" },
{ 169, "Universita degli Studi di Verona", "UniVR", null, "studenti.univr.it" },
{ 170, "???", "???", null, "suite.plala.or.jp" },
{ 171, "Sympatico Email", "Sympatico", "http://internet.bell.ca/index.cfm?method=content.view&category_id=585&content_id=12767", "sympatico.ca" },
{ 172, "???", "???", null, "symphony.plala.or.jp" },
{ 173, "T-Online", "T-Online", null, "t-online.de" },
{ 174, "???", "???", null, "taupe.plala.or.jp" },
{ 175, "Correo Terra", "Terra", null, "terra.es" },
{ 176, "TikiTiki???????", "TikiTiki", null, "tiki.ne.jp" },
{ 177, "Tiscali", "Tiscali", null, "tiscali.cz" },
{ 178, "Tiscali Italy", "Tiscali", "http://assistenza.tiscali.it/tecnica/posta/configurazioni/", "tiscali.it" },
{ 166, "?????????", "wind", null, "so.wind.ne.jp" },
{ 179, "???", "???", null, "tmail.plala.or.jp" },
{ 181, "???", "???", null, "topaz.plala.or.jp" },
{ 182, "???", "???", null, "trio.plala.or.jp" },
{ 183, "???", "???", null, "umail.plala.or.jp" },
{ 184, "UM ITCS Email", "UM ITCS", null, "umich.edu" },
{ 185, "UPC Nederland", "UPC", null, "upcmail.nl" },
{ 186, "Verizon Online", "Verizon", null, "verizon.net" },
{ 187, "Versatel", "Versatel", "http://www.versatel.de/hilfe/index_popup.php?einrichtung_email_programm", "versatel.de" },
{ 188, "???", "???", null, "violet.plala.or.jp" },
{ 189, "aikis", "aikis", null, "vm.aikis.or.jp" },
{ 190, "???", "???", null, "vmail.plala.or.jp" },
{ 191, "TikiTiki???????", "TikiTiki", null, "vp.tiki.ne.jp" },
{ 180, "???", "???", null, "toccata.plala.or.jp" },
{ 111, "?????????", "???", null, "mail.wind.ne.jp" },
{ 110, "Telenor Danmark", "Telenor", null, "mail.telenor.dk" },
{ 109, "mail.ru", "mail.ru", null, "mail.ru" },
{ 30, "???????????", "CEK-Net", null, "cek.ne.jp" },
{ 31, "UCSF CGL email", "CGL emai", null, "cgl.ucsf.edu" },
{ 32, "Charter Commuications", "Charter", null, "charter.com" },
{ 33, "CLIO-Net??????", "CLIO-Net", null, "clio.ne.jp" },
{ 34, "???", "???", null, "cmail.plala.or.jp" },
{ 35, "?????????", "wind", null, "co1.wind.ne.jp" },
{ 36, "?????????", "wind", null, "co2.wind.ne.jp" },
{ 37, "?????????", "wind", null, "co3.wind.ne.jp" },
{ 38, "???", "???", null, "cocoa.plala.or.jp" },
{ 39, "???", "Arcor", null, "coda.plala.or.jp" },
{ 40, "???", "Comcast", null, "comcast.net" },
{ 41, "???", "???", null, "concerto.plala.or.jp" },
{ 42, "???", "???", null, "coral.plala.or.jp" },
{ 43, "???", "???", null, "courante.plala.or.jp" },
{ 44, "???", "???", null, "cpost.plala.or.jp" },
{ 45, "???", "???", null, "cream.plala.or.jp" },
{ 46, "???", "wind", null, "dan.wind.ne.jp" },
{ 47, "???", "???", null, "dance.plala.or.jp" },
{ 48, "IIJ4U", "???", null, "dd.iij4u.or.jp" },
{ 49, "domainFACTORY", "domainFACTORY", "http://www.df.eu/de/service/df-faq/e-mail/mail-programme/", "df.eu" },
{ 50, "???", "???", null, "dmail.plala.or.jp" },
{ 51, "EarthLink", "EarthLink", "http://support.earthlink.net/email/email-server-settings.php", "earthlink.net" },
{ 52, "???", "???", null, "ebony.plala.or.jp" },
{ 29, "CC9???????????", "CC9", null, "cc9.ne.jp" },
{ 28, "???", "???", null, "cameo.plala.or.jp" },
{ 27, "???", "???", null, "camel.plala.or.jp" },
{ 26, "???", "???", null, "brown.plala.or.jp" },
{ 2, "???", "???", null, "abc.plala.or.jp" },
{ 3, "???", "???", null, "agate.plala.or.jp" },
{ 4, "Alice Italy", "Alice", "http://aiuto.alice.it/informazioni/clientemail/thunderbird.html", "alice.it" },
{ 5, "???", "???", null, "amail.plala.or.jp" },
{ 6, "???", "???", null, "amber.plala.or.jp" },
{ 7, "AOL Mail", "AOL", null, "aol.com" },
{ 8, "???", "???", null, "apost.plala.or.jp" },
{ 9, "???", "???", null, "aqua.plala.or.jp" },
{ 10, "Arcor", "Arcor", null, "arcor.de" },
{ 11, "Aruba PEC", "Aruba", "http://pec.aruba.it/guide_filmate.asp", "arubapec.it" },
{ 12, "AT&T", "AT&T", "http://www.att.com/esupport/article.jsp?sid=KB401570&ct=9000152", "att.net" },
{ 53, "email.it", "email.it", "http://www.email.it/ita/config/thunder.php", "email.it" },
{ 13, "???", "???", null, "ballade.plala.or.jp" },
{ 15, "BB????", "BB-NIIGATA", null, "bb-niigata.jp" },
{ 16, "???", "???", null, "beige.plala.or.jp" },
{ 17, "Biglobe", "Biglobe", null, "biglobe.ne.jp" },
{ 18, "Telstra Bigpond", "Bigpond", null, "bigpond.com" },
{ 19, "???", "???", null, "blue.plala.or.jp" },
{ 20, "bluewin.ch", "bluewin.ch", "http://smtphelp.bluewin.ch/swisscomdtg/setup/?", "bluemail.ch" },
{ 21, "bluewin.ch", "bluewin.ch", "http://smtphelp.bluewin.ch/swisscomdtg/setup/", "bluewin.ch" },
{ 22, "???", "???", null, "bmail.plala.or.jp" },
{ 23, "???", "???", null, "bolero.plala.or.jp" },
{ 24, "???", "???", null, "bpost.plala.or.jp" },
{ 25, "???", "???", null, "broba.cc" },
{ 14, "?????????", "wind", null, "bay.wind.ne.jp" },
{ 54, "???", "???", null, "email.plala.or.jp" },
{ 55, "EWE Tel", "EWE Tel", null, "ewetel.de" },
{ 56, "???", "???", null, "fantasy.plala.or.jp" },
{ 85, "IPAX Internet Services", "IPAX", null, "ipax.at" },
{ 86, "???", "???", null, "ivory.plala.or.jp" },
{ 87, "???????????", "IWAFUNE", null, "iwafune.ne.jp" },
{ 88, "???", "???", null, "jade.plala.or.jp" },
{ 89, "Janis", "Janis", null, "janis.or.jp" },
{ 90, "JETINTERNET", "JET", null, "jet.ne.jp" },
{ 91, "JETINTERNET", "JET", null, "ji.jet.ne.jp" },
{ 92, "???", "???", null, "jmail.plala.or.jp" },
{ 93, "Kabel Deutschland", "Kabel D", null, "kabelmail.de" },
{ 94, "KELCOM Internet", "KELCOM", null, "kelcom.net" },
{ 95, "???", "???", null, "khaki.plala.or.jp" },
{ 84, "Internode", "Internode", "http://www.internode.on.net/support/guides/email/secure_email/", "internode.on.net" },
{ 96, "?????????", "wind", null, "kl.wind.ne.jp" },
{ 98, "????????????", "?????", null, "kokuyou.ne.jp" },
{ 99, "???", "???", null, "lapis.plala.or.jp" },
{ 100, "LaPoste", "LaPoste", "http://www.geckozone.org/forum/viewtopic.php?f=4&t=93118", "laposte.net" },
{ 101, "???", "???", null, "lemon.plala.or.jp" },
{ 102, "Libero Mail", "Libero", "http://aiuto.libero.it/mail/istruzioni/configura-mozilla-thunderbird-per-windows-a11.phtml", "libero.it" },
{ 103, "???", "???", null, "lilac.plala.or.jp" },
{ 104, "???", "???", null, "lime.plala.or.jp" },
{ 105, "???????????", "????", null, "mahoroba.ne.jp" },
{ 106, "mail.com", "mail.com", null, "mail.com" },
{ 107, "TDC (DK)", "TDC", null, "mail.dk" },
{ 108, "???????????", "IWAFUNE", null, "mail.iwafune.ne.jp" },
{ 97, "???", "???", null, "kmail.plala.or.jp" },
{ 220, "Apple iCloud", "Apple", null, "icloud.com" },
{ 83, "??????????", "INET-SHIBATA", null, "inet-shibata.or.jp" },
{ 81, "Inbox.lv", "Inbox.lv", null, "inbox.lv" },
{ 57, "???", "???", null, "flamenco.plala.or.jp" },
{ 58, "???", "???", null, "fmail.plala.or.jp" },
{ 59, "France Telecom / Orange", "Orange", null, "francetelecom.fr" },
{ 60, "Free Telecom", "free.fr", "http://www.free.fr/assistance/599-thunderbird.html", "free.fr" },
{ 61, "Freenet Mail", "Freenet", null, "freenet.de" },
{ 62, "???", "???", null, "fuga.plala.or.jp" },
{ 63, "Gandi Mail", "Gandi", null, "gandi.net" },
{ 64, "???", "???", null, "gmail.plala.or.jp" },
{ 65, "GMX Freemail", "GMX", null, "gmx.com" },
{ 66, "GMX Freemail", "GMX", null, "gmx.net" },
{ 67, "????????????????????", "TVM-Net", null, "go.tvm.ne.jp" },
{ 82, "???", "???", null, "indigo.plala.or.jp" },
{ 68, "goo ????????", "goo", null, "goo.jp" },
{ 70, "???", "???", null, "grape.plala.or.jp" },
{ 71, "???", "???", null, "gray.plala.or.jp" },
{ 72, "?????????", "HAL", null, "hal.ne.jp" },
{ 73, "????????", "????", null, "hana.or.jp" },
{ 74, "Microsoft Live Hotmail", "Hotmail", null, "hotmail.com" },
{ 75, "SoftBank", "SoftBank", null, "i.softbank.jp" },
{ 76, "IC-NET", "IC-NET", null, "ic-net.or.jp" },
{ 77, "IIJmio ????????", "IIJmio", null, "iijmio-mail.jp" },
{ 78, "???????i?????", "i?????", null, "iiyama-catv.ne.jp" },
{ 79, "???", "???", null, "imail.plala.or.jp" },
{ 80, "Inbox.lt", "Inbox.lt", null, "inbox.lt" },
{ 69, "Google Mail", "GMail", null, "googlemail.com" },
{ 221, "Microsoft Office 365", "Office365", "https://products.office.com", "office365.com" }
});
migrationBuilder.CreateIndex(
name: "address_index",
table: "mail_mailbox",
column: "address");
migrationBuilder.CreateIndex(
name: "date_login_delay_expires",
table: "mail_mailbox",
columns: new[] { "date_checked", "date_login_delay_expires" });
migrationBuilder.CreateIndex(
name: "main_mailbox_id_in_server_mail_mailbox_server_id",
table: "mail_mailbox",
column: "id_in_server");
migrationBuilder.CreateIndex(
name: "main_mailbox_id_smtp_server_mail_mailbox_server_id",
table: "mail_mailbox",
column: "id_smtp_server");
migrationBuilder.CreateIndex(
name: "user_id_index",
table: "mail_mailbox",
columns: new[] { "tenant", "id_user" });
migrationBuilder.CreateIndex(
name: "mail_server_server_type_server_type_fk_id",
table: "mail_server_server",
column: "server_type");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ApiKeys");
migrationBuilder.DropTable(
name: "GreyListingWhiteList");
migrationBuilder.DropTable(
name: "mail_mailbox");
migrationBuilder.DropTable(
name: "mail_mailbox_provider");
migrationBuilder.DropTable(
name: "mail_server_server");
migrationBuilder.DropTable(
name: "MailboxServer");
}
}
}

View File

@ -0,0 +1,356 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql
{
[DbContext(typeof(MySqlMessagesContext))]
[Migration("20211012145334_MessagesContextMySql")]
partial class MessagesContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.AuditEvent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(20000)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Initiator")
.HasColumnType("varchar(200)")
.HasColumnName("initiator")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Target")
.HasColumnType("text")
.HasColumnName("target")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("TenantId", "Date")
.HasDatabaseName("date");
b.ToTable("audit_events");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Alias")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("alias")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Calls")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("calls")
.HasDefaultValueSql("true");
b.Property<DateTime>("CreationDateTime")
.HasColumnType("datetime")
.HasColumnName("creationdatetime");
b.Property<int?>("Industry")
.HasColumnType("int")
.HasColumnName("industry");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("char(10)")
.HasColumnName("language")
.HasDefaultValueSql("'en-US'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("MappedDomain")
.HasColumnType("varchar(100)")
.HasColumnName("mappeddomain")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("owner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PaymentId")
.HasColumnType("varchar(38)")
.HasColumnName("payment_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Spam")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("spam")
.HasDefaultValueSql("true");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<DateTime?>("StatusChanged")
.HasColumnType("datetime")
.HasColumnName("statuschanged");
b.Property<string>("TimeZone")
.HasColumnType("varchar(50)")
.HasColumnName("timezone")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TrustedDomains")
.HasColumnType("varchar(1024)")
.HasColumnName("trusteddomains")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TrustedDomainsEnabled")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("trusteddomainsenabled")
.HasDefaultValueSql("'1'");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("version")
.HasDefaultValueSql("'2'");
b.Property<DateTime?>("Version_Changed")
.HasColumnType("datetime")
.HasColumnName("version_changed");
b.HasKey("Id");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("MappedDomain")
.HasDatabaseName("mappeddomain");
b.HasIndex("Version")
.HasDatabaseName("version");
b.ToTable("tenants_tenants");
b.HasData(
new
{
Id = 1,
Alias = "localhost",
Calls = false,
CreationDateTime = new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317),
LastModified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Name = "Web Office",
OwnerId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
Spam = false,
Status = 0,
TrustedDomainsEnabled = 0,
Version = 0
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioSettings", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("TenantID");
b.Property<string>("Id")
.HasColumnType("varchar(64)")
.HasColumnName("ID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("varchar(64)")
.HasColumnName("UserID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Data")
.IsRequired()
.HasColumnType("mediumtext")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId", "Id", "UserId")
.HasName("PRIMARY");
b.HasIndex("Id")
.HasDatabaseName("ID");
b.ToTable("webstudio_settings");
b.HasData(
new
{
TenantId = 1,
Id = "9a925891-1f92-4ed7-b277-d6f649739f06",
UserId = "00000000-0000-0000-0000-000000000000",
Data = "{'Completed':false}"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(500)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Login")
.HasColumnType("varchar(200)")
.HasColumnName("login")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("Date")
.HasDatabaseName("date");
b.HasIndex("TenantId", "UserId")
.HasDatabaseName("tenant_id");
b.ToTable("login_events");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,95 +1,95 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql
{
[DbContext(typeof(MySqlMessagesContext))]
partial class MySqlMessagesContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(500)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Login")
.HasColumnType("varchar(200)")
.HasColumnName("login")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("Date")
.HasDatabaseName("date");
b.HasIndex("TenantId", "UserId")
.HasDatabaseName("tenant_id");
b.ToTable("login_events");
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql
{
[DbContext(typeof(MySqlMessagesContext))]
partial class MySqlMessagesContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(500)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Login")
.HasColumnType("varchar(200)")
.HasColumnName("login")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("Date")
.HasDatabaseName("date");
b.HasIndex("TenantId", "UserId")
.HasDatabaseName("tenant_id");
b.ToTable("login_events");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,131 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.NotifyDbContextMySql
{
[DbContext(typeof(MySqlNotifyDbContext))]
[Migration("20211012145336_NotifyDbContextMySql")]
partial class NotifyDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.NotifyInfo", b =>
{
b.Property<int>("NotifyId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("notify_id");
b.Property<int>("Attempts")
.HasColumnType("int")
.HasColumnName("attempts");
b.Property<DateTime>("ModifyDate")
.HasColumnType("datetime")
.HasColumnName("modify_date");
b.Property<int>("Priority")
.HasColumnType("int")
.HasColumnName("priority");
b.Property<int>("State")
.HasColumnType("int")
.HasColumnName("state");
b.HasKey("NotifyId")
.HasName("PRIMARY");
b.HasIndex("State")
.HasDatabaseName("state");
b.ToTable("notify_info");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.NotifyQueue", b =>
{
b.Property<int>("NotifyId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("notify_id");
b.Property<string>("Attachments")
.HasColumnType("text")
.HasColumnName("attachments")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("AutoSubmitted")
.HasColumnType("varchar(64)")
.HasColumnName("auto_submitted")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Content")
.HasColumnType("text")
.HasColumnName("content")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ContentType")
.HasColumnType("varchar(64)")
.HasColumnName("content_type")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime")
.HasColumnName("creation_date");
b.Property<string>("Reciever")
.HasColumnType("varchar(255)")
.HasColumnName("reciever")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ReplyTo")
.HasColumnType("varchar(1024)")
.HasColumnName("reply_to")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Sender")
.HasColumnType("varchar(255)")
.HasColumnName("sender")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("SenderType")
.HasColumnType("varchar(64)")
.HasColumnName("sender_type")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Subject")
.HasColumnType("varchar(1024)")
.HasColumnName("subject")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.HasKey("NotifyId")
.HasName("PRIMARY");
b.ToTable("notify_queue");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,79 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.NotifyDbContextMySql
{
public partial class NotifyDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "notify_info",
columns: table => new
{
notify_id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
state = table.Column<int>(type: "int", nullable: false),
attempts = table.Column<int>(type: "int", nullable: false),
modify_date = table.Column<DateTime>(type: "datetime", nullable: false),
priority = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.notify_id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "notify_queue",
columns: table => new
{
notify_id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
tenant_id = table.Column<int>(type: "int", nullable: false),
sender = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
reciever = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
subject = table.Column<string>(type: "varchar(1024)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
content_type = table.Column<string>(type: "varchar(64)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
content = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
sender_type = table.Column<string>(type: "varchar(64)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
reply_to = table.Column<string>(type: "varchar(1024)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
creation_date = table.Column<DateTime>(type: "datetime", nullable: false),
attachments = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
auto_submitted = table.Column<string>(type: "varchar(64)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.notify_id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "state",
table: "notify_info",
column: "state");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "notify_info");
migrationBuilder.DropTable(
name: "notify_queue");
}
}
}

View File

@ -0,0 +1,317 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.ResourceDbContextMySql
{
[DbContext(typeof(MySqlResourceDbContext))]
[Migration("20211012145338_ResourceDbContextMySql")]
partial class ResourceDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.Resource.ResAuthors", b =>
{
b.Property<string>("Login")
.HasColumnType("varchar(150)")
.HasColumnName("login")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("IsAdmin")
.HasColumnType("tinyint(1)")
.HasColumnName("isAdmin");
b.Property<DateTime>("LastVisit")
.HasColumnType("datetime")
.HasColumnName("lastVisit");
b.Property<bool>("Online")
.HasColumnType("tinyint(1)")
.HasColumnName("online");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("password")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Login")
.HasName("PRIMARY");
b.ToTable("res_authors");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Resource.ResAuthorsFile", b =>
{
b.Property<string>("AuthorLogin")
.HasColumnType("varchar(50)")
.HasColumnName("authorLogin")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("FileId")
.HasColumnType("int")
.HasColumnName("fileid");
b.Property<bool>("WriteAccess")
.HasColumnType("tinyint(1)")
.HasColumnName("writeAccess");
b.HasKey("AuthorLogin", "FileId")
.HasName("PRIMARY");
b.HasIndex("FileId")
.HasDatabaseName("res_authorsfile_FK2");
b.ToTable("res_authorsfile");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Resource.ResAuthorsLang", b =>
{
b.Property<string>("AuthorLogin")
.HasColumnType("varchar(50)")
.HasColumnName("authorLogin")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("CultureTitle")
.HasColumnType("varchar(20)")
.HasColumnName("cultureTitle")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("AuthorLogin", "CultureTitle")
.HasName("PRIMARY");
b.HasIndex("CultureTitle")
.HasDatabaseName("res_authorslang_FK2");
b.ToTable("res_authorslang");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Resource.ResCultures", b =>
{
b.Property<string>("Title")
.HasColumnType("varchar(120)")
.HasColumnName("title")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Available")
.HasColumnType("tinyint(1)")
.HasColumnName("available");
b.Property<DateTime>("CreationDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("creationDate")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("varchar(120)")
.HasColumnName("value")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Title")
.HasName("PRIMARY");
b.ToTable("res_cultures");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Resource.ResData", b =>
{
b.Property<int>("FileId")
.HasColumnType("int")
.HasColumnName("fileid");
b.Property<string>("CultureTitle")
.HasColumnType("varchar(20)")
.HasColumnName("cultureTitle")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Title")
.HasColumnType("varchar(120)")
.HasColumnName("title")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("AuthorLogin")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("varchar(50)")
.HasColumnName("authorLogin")
.HasDefaultValueSql("'Console'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Description")
.HasColumnType("text")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Flag")
.HasColumnType("int")
.HasColumnName("flag");
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Link")
.HasColumnType("varchar(120)")
.HasColumnName("link")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ResourceType")
.HasColumnType("varchar(20)")
.HasColumnName("resourceType")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TextValue")
.HasColumnType("text")
.HasColumnName("textValue")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("TimeChanges")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("timeChanges")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.HasKey("FileId", "CultureTitle", "Title")
.HasName("PRIMARY");
b.HasIndex("CultureTitle")
.HasDatabaseName("resources_FK2");
b.HasIndex("Id")
.IsUnique()
.HasDatabaseName("id");
b.HasIndex("TimeChanges")
.HasDatabaseName("dateIndex");
b.ToTable("res_data");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Resource.ResFiles", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<DateTime>("CreationDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("creationDate")
.HasDefaultValueSql("'0000-00-00 00:00:00'");
b.Property<bool>("IsLock")
.HasColumnType("tinyint(1)")
.HasColumnName("isLock");
b.Property<DateTime>("LastUpdate")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("lastUpdate")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("ModuleName")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("moduleName")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ProjectName")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("projectName")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ResName")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("resName")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("ResName")
.IsUnique()
.HasDatabaseName("resname");
b.ToTable("res_files");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.Resource.ResReserve", b =>
{
b.Property<int>("FileId")
.HasColumnType("int")
.HasColumnName("fileid");
b.Property<string>("Title")
.HasColumnType("varchar(120)")
.HasColumnName("title")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("CultureTitle")
.HasColumnType("varchar(20)")
.HasColumnName("cultureTitle")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Flag")
.HasColumnType("int")
.HasColumnName("flag");
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("TextValue")
.HasColumnType("text")
.HasColumnName("textValue")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("FileId", "Title", "CultureTitle")
.HasName("PRIMARY");
b.HasIndex("CultureTitle")
.HasDatabaseName("resources_FK2");
b.HasIndex("Id")
.IsUnique()
.HasDatabaseName("id");
b.ToTable("res_reserve");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,220 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.ResourceDbContextMySql
{
public partial class ResourceDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "res_authors",
columns: table => new
{
login = table.Column<string>(type: "varchar(150)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
password = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
isAdmin = table.Column<bool>(type: "tinyint(1)", nullable: false),
online = table.Column<bool>(type: "tinyint(1)", nullable: false),
lastVisit = table.Column<DateTime>(type: "datetime", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.login);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "res_authorsfile",
columns: table => new
{
authorLogin = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
fileid = table.Column<int>(type: "int", nullable: false),
writeAccess = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.authorLogin, x.fileid });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "res_authorslang",
columns: table => new
{
authorLogin = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
cultureTitle = table.Column<string>(type: "varchar(20)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.authorLogin, x.cultureTitle });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "res_cultures",
columns: table => new
{
title = table.Column<string>(type: "varchar(120)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
value = table.Column<string>(type: "varchar(120)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
available = table.Column<bool>(type: "tinyint(1)", nullable: false),
creationDate = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.title);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "res_data",
columns: table => new
{
fileid = table.Column<int>(type: "int", nullable: false),
title = table.Column<string>(type: "varchar(120)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
cultureTitle = table.Column<string>(type: "varchar(20)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
textValue = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
description = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
timeChanges = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
resourceType = table.Column<string>(type: "varchar(20)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
flag = table.Column<int>(type: "int", nullable: false),
link = table.Column<string>(type: "varchar(120)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
authorLogin = table.Column<string>(type: "varchar(50)", nullable: false, defaultValueSql: "'Console'", collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.fileid, x.cultureTitle, x.title });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "res_files",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
projectName = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
moduleName = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
resName = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
isLock = table.Column<bool>(type: "tinyint(1)", nullable: false),
lastUpdate = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
creationDate = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "'0000-00-00 00:00:00'")
},
constraints: table =>
{
table.PrimaryKey("PK_res_files", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "res_reserve",
columns: table => new
{
fileid = table.Column<int>(type: "int", nullable: false),
title = table.Column<string>(type: "varchar(120)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
cultureTitle = table.Column<string>(type: "varchar(20)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
textValue = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
flag = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.fileid, x.title, x.cultureTitle });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "res_authorsfile_FK2",
table: "res_authorsfile",
column: "fileid");
migrationBuilder.CreateIndex(
name: "res_authorslang_FK2",
table: "res_authorslang",
column: "cultureTitle");
migrationBuilder.CreateIndex(
name: "dateIndex",
table: "res_data",
column: "timeChanges");
migrationBuilder.CreateIndex(
name: "id",
table: "res_data",
column: "id",
unique: true);
migrationBuilder.CreateIndex(
name: "resources_FK2",
table: "res_data",
column: "cultureTitle");
migrationBuilder.CreateIndex(
name: "resname",
table: "res_files",
column: "resName",
unique: true);
migrationBuilder.CreateIndex(
name: "id",
table: "res_reserve",
column: "id",
unique: true);
migrationBuilder.CreateIndex(
name: "resources_FK2",
table: "res_reserve",
column: "cultureTitle");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "res_authors");
migrationBuilder.DropTable(
name: "res_authorsfile");
migrationBuilder.DropTable(
name: "res_authorslang");
migrationBuilder.DropTable(
name: "res_cultures");
migrationBuilder.DropTable(
name: "res_data");
migrationBuilder.DropTable(
name: "res_files");
migrationBuilder.DropTable(
name: "res_reserve");
}
}
}

View File

@ -0,0 +1,48 @@
// <auto-generated />
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.TelegramDbContextMySql
{
[DbContext(typeof(MySqlTelegramDbContext))]
[Migration("20211012145340_TelegramDbContextMySql")]
partial class TelegramDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.TelegramUser", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("PortalUserId")
.HasColumnType("varchar(38)")
.HasColumnName("portal_user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TelegramUserId")
.HasColumnType("int")
.HasColumnName("telegram_user_id");
b.HasKey("TenantId", "PortalUserId")
.HasName("PRIMARY");
b.HasIndex("TelegramUserId")
.HasDatabaseName("tgId");
b.ToTable("telegram_users");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.TelegramDbContextMySql
{
public partial class TelegramDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "telegram_users",
columns: table => new
{
portal_user_id = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
tenant_id = table.Column<int>(type: "int", nullable: false),
telegram_user_id = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenant_id, x.portal_user_id });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "tgId",
table: "telegram_users",
column: "telegram_user_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "telegram_users");
}
}
}

View File

@ -0,0 +1,332 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.TenantDbContextMySql
{
[DbContext(typeof(MySqlTenantDbContext))]
[Migration("20211012145342_TenantDbContextMySql")]
partial class TenantDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbCoreSettings", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<string>("Id")
.HasColumnType("varchar(128)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<byte[]>("Value")
.IsRequired()
.HasColumnType("mediumblob")
.HasColumnName("value");
b.HasKey("Tenant", "Id")
.HasName("PRIMARY");
b.ToTable("core_settings");
b.HasData(
new
{
Tenant = -1,
Id = "CompanyWhiteLabelSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 21, 897, DateTimeKind.Utc).AddTicks(8351),
Value = new byte[] { 245, 71, 4, 138, 72, 101, 23, 21, 135, 217, 206, 188, 138, 73, 108, 96, 29, 150, 3, 31, 44, 28, 62, 145, 96, 53, 57, 66, 238, 118, 93, 172, 211, 22, 244, 181, 244, 40, 146, 67, 111, 196, 162, 27, 154, 109, 248, 255, 211, 188, 64, 54, 180, 126, 58, 90, 27, 76, 136, 27, 38, 96, 152, 105, 254, 187, 104, 72, 189, 136, 192, 46, 234, 198, 164, 204, 179, 232, 244, 4, 41, 8, 18, 240, 230, 225, 36, 165, 82, 190, 129, 165, 140, 100, 187, 139, 211, 201, 168, 192, 237, 225, 249, 66, 18, 129, 222, 12, 122, 248, 39, 51, 164, 188, 229, 21, 232, 86, 148, 196, 221, 167, 142, 34, 101, 43, 162, 137, 31, 206, 149, 120, 249, 114, 133, 168, 30, 18, 254, 223, 93, 101, 88, 97, 30, 58, 163, 224, 62, 173, 220, 170, 152, 40, 124, 100, 165, 81, 7, 87, 168, 129, 176, 12, 51, 69, 230, 252, 30, 34, 182, 7, 202, 45, 117, 60, 99, 241, 237, 148, 201, 35, 102, 219, 160, 228, 194, 230, 219, 22, 244, 74, 138, 176, 145, 0, 122, 167, 80, 93, 23, 228, 21, 48, 100, 60, 31, 250, 232, 34, 248, 249, 159, 210, 227, 12, 13, 239, 130, 223, 101, 196, 51, 36, 80, 127, 62, 92, 104, 228, 197, 226, 43, 232, 164, 12, 36, 66, 52, 133 }
},
new
{
Tenant = -1,
Id = "FullTextSearchSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 21, 897, DateTimeKind.Utc).AddTicks(8555),
Value = new byte[] { 8, 120, 207, 5, 153, 181, 23, 202, 162, 211, 218, 237, 157, 6, 76, 62, 220, 238, 175, 67, 31, 53, 166, 246, 66, 220, 173, 160, 72, 23, 227, 81, 50, 39, 187, 177, 222, 110, 43, 171, 235, 158, 16, 119, 178, 207, 49, 140, 72, 152, 20, 84, 94, 135, 117, 1, 246, 51, 251, 190, 148, 2, 44, 252, 221, 2, 91, 83, 149, 151, 58, 245, 16, 148, 52, 8, 187, 86, 150, 46, 227, 93, 163, 95, 47, 131, 116, 207, 95, 209, 38, 149, 53, 148, 73, 215, 206, 251, 194, 199, 189, 17, 42, 229, 135, 82, 23, 154, 162, 165, 158, 94, 23, 128, 30, 88, 12, 204, 96, 250, 236, 142, 189, 211, 214, 18, 196, 136, 102, 102, 217, 109, 108, 240, 96, 96, 94, 100, 201, 10, 31, 170, 128, 192 }
},
new
{
Tenant = -1,
Id = "SmtpSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 21, 897, DateTimeKind.Utc).AddTicks(8559),
Value = new byte[] { 240, 82, 224, 144, 161, 163, 117, 13, 173, 205, 78, 153, 97, 218, 4, 170, 81, 239, 1, 151, 226, 192, 98, 60, 241, 44, 88, 56, 191, 164, 10, 155, 72, 186, 239, 203, 227, 113, 88, 119, 49, 215, 227, 220, 158, 124, 96, 9, 116, 47, 158, 65, 93, 86, 219, 15, 10, 224, 142, 50, 248, 144, 75, 44, 68, 28, 198, 87, 198, 69, 67, 234, 238, 38, 32, 68, 162, 139, 67, 53, 220, 176, 240, 196, 233, 64, 29, 137, 31, 160, 99, 105, 249, 132, 202, 45, 71, 92, 134, 194, 55, 145, 121, 97, 197, 130, 119, 105, 131, 21, 133, 35, 10, 102, 172, 119, 135, 230, 251, 86, 253, 62, 55, 56, 146, 103, 164, 106 }
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Alias")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("alias")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Calls")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("calls")
.HasDefaultValueSql("true");
b.Property<DateTime>("CreationDateTime")
.HasColumnType("datetime")
.HasColumnName("creationdatetime");
b.Property<int?>("Industry")
.HasColumnType("int")
.HasColumnName("industry");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("char(10)")
.HasColumnName("language")
.HasDefaultValueSql("'en-US'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("MappedDomain")
.HasColumnType("varchar(100)")
.HasColumnName("mappeddomain")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("owner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PaymentId")
.HasColumnType("varchar(38)")
.HasColumnName("payment_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Spam")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("spam")
.HasDefaultValueSql("true");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<DateTime?>("StatusChanged")
.HasColumnType("datetime")
.HasColumnName("statuschanged");
b.Property<string>("TimeZone")
.HasColumnType("varchar(50)")
.HasColumnName("timezone")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TrustedDomains")
.HasColumnType("varchar(1024)")
.HasColumnName("trusteddomains")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TrustedDomainsEnabled")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("trusteddomainsenabled")
.HasDefaultValueSql("'1'");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("version")
.HasDefaultValueSql("'2'");
b.Property<DateTime?>("Version_Changed")
.HasColumnType("datetime")
.HasColumnName("version_changed");
b.HasKey("Id");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("MappedDomain")
.HasDatabaseName("mappeddomain");
b.HasIndex("Version")
.HasDatabaseName("version");
b.ToTable("tenants_tenants");
b.HasData(
new
{
Id = 1,
Alias = "localhost",
Calls = false,
CreationDateTime = new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317),
LastModified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Name = "Web Office",
OwnerId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
Spam = false,
Status = 0,
TrustedDomainsEnabled = 0,
Version = 0
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantForbiden", b =>
{
b.Property<string>("Address")
.HasColumnType("varchar(50)")
.HasColumnName("address")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Address")
.HasName("PRIMARY");
b.ToTable("tenants_forbiden");
b.HasData(
new
{
Address = "controlpanel"
},
new
{
Address = "localhost"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantPartner", b =>
{
b.Property<int>("TenantId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("AffiliateId")
.HasColumnType("varchar(50)")
.HasColumnName("affiliate_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Campaign")
.HasColumnType("varchar(50)")
.HasColumnName("campaign")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PartnerId")
.HasColumnType("varchar(36)")
.HasColumnName("partner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId")
.HasName("PRIMARY");
b.ToTable("tenants_partners");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantVersion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("DefaultVersion")
.HasColumnType("int")
.HasColumnName("default_version");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("version")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Visible")
.HasColumnType("tinyint(1)")
.HasColumnName("visible");
b.HasKey("Id");
b.ToTable("tenants_version");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.TenantIpRestrictions", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Ip")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("Id");
b.HasIndex("Tenant")
.HasDatabaseName("tenant");
b.ToTable("tenants_iprestrictions");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,203 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.TenantDbContextMySql
{
public partial class TenantDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "core_settings",
columns: table => new
{
tenant = table.Column<int>(type: "int", nullable: false),
id = table.Column<string>(type: "varchar(128)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
value = table.Column<byte[]>(type: "mediumblob", nullable: false),
last_modified = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenant, x.id });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tenants_forbiden",
columns: table => new
{
address = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.address);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tenants_iprestrictions",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
tenant = table.Column<int>(type: "int", nullable: false),
ip = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PK_tenants_iprestrictions", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tenants_partners",
columns: table => new
{
tenant_id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
partner_id = table.Column<string>(type: "varchar(36)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
affiliate_id = table.Column<string>(type: "varchar(50)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
campaign = table.Column<string>(type: "varchar(50)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.tenant_id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tenants_tenants",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
name = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
alias = table.Column<string>(type: "varchar(100)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
mappeddomain = table.Column<string>(type: "varchar(100)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
version = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'2'"),
version_changed = table.Column<DateTime>(type: "datetime", nullable: true),
language = table.Column<string>(type: "char(10)", nullable: false, defaultValueSql: "'en-US'", collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
timezone = table.Column<string>(type: "varchar(50)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
trusteddomains = table.Column<string>(type: "varchar(1024)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
trusteddomainsenabled = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'1'"),
status = table.Column<int>(type: "int", nullable: false),
statuschanged = table.Column<DateTime>(type: "datetime", nullable: true),
creationdatetime = table.Column<DateTime>(type: "datetime", nullable: false),
owner_id = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
payment_id = table.Column<string>(type: "varchar(38)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
industry = table.Column<int>(type: "int", nullable: true),
last_modified = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
spam = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValueSql: "true"),
calls = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValueSql: "true")
},
constraints: table =>
{
table.PrimaryKey("PK_tenants_tenants", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tenants_version",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
version = table.Column<string>(type: "varchar(64)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
url = table.Column<string>(type: "varchar(64)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
default_version = table.Column<int>(type: "int", nullable: false),
visible = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_tenants_version", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "core_settings",
columns: new[] { "id", "tenant", "value" },
values: new object[,]
{
{ "CompanyWhiteLabelSettings", -1, new byte[] { 245, 71, 4, 138, 72, 101, 23, 21, 135, 217, 206, 188, 138, 73, 108, 96, 29, 150, 3, 31, 44, 28, 62, 145, 96, 53, 57, 66, 238, 118, 93, 172, 211, 22, 244, 181, 244, 40, 146, 67, 111, 196, 162, 27, 154, 109, 248, 255, 211, 188, 64, 54, 180, 126, 58, 90, 27, 76, 136, 27, 38, 96, 152, 105, 254, 187, 104, 72, 189, 136, 192, 46, 234, 198, 164, 204, 179, 232, 244, 4, 41, 8, 18, 240, 230, 225, 36, 165, 82, 190, 129, 165, 140, 100, 187, 139, 211, 201, 168, 192, 237, 225, 249, 66, 18, 129, 222, 12, 122, 248, 39, 51, 164, 188, 229, 21, 232, 86, 148, 196, 221, 167, 142, 34, 101, 43, 162, 137, 31, 206, 149, 120, 249, 114, 133, 168, 30, 18, 254, 223, 93, 101, 88, 97, 30, 58, 163, 224, 62, 173, 220, 170, 152, 40, 124, 100, 165, 81, 7, 87, 168, 129, 176, 12, 51, 69, 230, 252, 30, 34, 182, 7, 202, 45, 117, 60, 99, 241, 237, 148, 201, 35, 102, 219, 160, 228, 194, 230, 219, 22, 244, 74, 138, 176, 145, 0, 122, 167, 80, 93, 23, 228, 21, 48, 100, 60, 31, 250, 232, 34, 248, 249, 159, 210, 227, 12, 13, 239, 130, 223, 101, 196, 51, 36, 80, 127, 62, 92, 104, 228, 197, 226, 43, 232, 164, 12, 36, 66, 52, 133 } },
{ "FullTextSearchSettings", -1, new byte[] { 8, 120, 207, 5, 153, 181, 23, 202, 162, 211, 218, 237, 157, 6, 76, 62, 220, 238, 175, 67, 31, 53, 166, 246, 66, 220, 173, 160, 72, 23, 227, 81, 50, 39, 187, 177, 222, 110, 43, 171, 235, 158, 16, 119, 178, 207, 49, 140, 72, 152, 20, 84, 94, 135, 117, 1, 246, 51, 251, 190, 148, 2, 44, 252, 221, 2, 91, 83, 149, 151, 58, 245, 16, 148, 52, 8, 187, 86, 150, 46, 227, 93, 163, 95, 47, 131, 116, 207, 95, 209, 38, 149, 53, 148, 73, 215, 206, 251, 194, 199, 189, 17, 42, 229, 135, 82, 23, 154, 162, 165, 158, 94, 23, 128, 30, 88, 12, 204, 96, 250, 236, 142, 189, 211, 214, 18, 196, 136, 102, 102, 217, 109, 108, 240, 96, 96, 94, 100, 201, 10, 31, 170, 128, 192 } },
{ "SmtpSettings", -1, new byte[] { 240, 82, 224, 144, 161, 163, 117, 13, 173, 205, 78, 153, 97, 218, 4, 170, 81, 239, 1, 151, 226, 192, 98, 60, 241, 44, 88, 56, 191, 164, 10, 155, 72, 186, 239, 203, 227, 113, 88, 119, 49, 215, 227, 220, 158, 124, 96, 9, 116, 47, 158, 65, 93, 86, 219, 15, 10, 224, 142, 50, 248, 144, 75, 44, 68, 28, 198, 87, 198, 69, 67, 234, 238, 38, 32, 68, 162, 139, 67, 53, 220, 176, 240, 196, 233, 64, 29, 137, 31, 160, 99, 105, 249, 132, 202, 45, 71, 92, 134, 194, 55, 145, 121, 97, 197, 130, 119, 105, 131, 21, 133, 35, 10, 102, 172, 119, 135, 230, 251, 86, 253, 62, 55, 56, 146, 103, 164, 106 } }
});
migrationBuilder.InsertData(
table: "tenants_forbiden",
column: "address",
values: new object[]
{
"controlpanel",
"localhost"
});
migrationBuilder.InsertData(
table: "tenants_tenants",
columns: new[] { "id", "alias", "creationdatetime", "industry", "mappeddomain", "name", "owner_id", "payment_id", "status", "statuschanged", "timezone", "trusteddomains", "version_changed" },
values: new object[] { 1, "localhost", new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317), null, null, "Web Office", "66faa6e4-f133-11ea-b126-00ffeec8b4ef", null, 0, null, null, null, null });
migrationBuilder.CreateIndex(
name: "tenant",
table: "tenants_iprestrictions",
column: "tenant");
migrationBuilder.CreateIndex(
name: "last_modified",
table: "tenants_tenants",
column: "last_modified");
migrationBuilder.CreateIndex(
name: "mappeddomain",
table: "tenants_tenants",
column: "mappeddomain");
migrationBuilder.CreateIndex(
name: "version",
table: "tenants_tenants",
column: "version");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "core_settings");
migrationBuilder.DropTable(
name: "tenants_forbiden");
migrationBuilder.DropTable(
name: "tenants_iprestrictions");
migrationBuilder.DropTable(
name: "tenants_partners");
migrationBuilder.DropTable(
name: "tenants_tenants");
migrationBuilder.DropTable(
name: "tenants_version");
}
}
}

View File

@ -1,330 +1,330 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.TenantDbContextMySql
{
[DbContext(typeof(MySqlTenantDbContext))]
partial class MySqlTenantDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbCoreSettings", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<string>("Id")
.HasColumnType("varchar(128)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<byte[]>("Value")
.IsRequired()
.HasColumnType("mediumblob")
.HasColumnName("value");
b.HasKey("Tenant", "Id")
.HasName("PRIMARY");
b.ToTable("core_settings");
b.HasData(
new
{
Tenant = -1,
Id = "CompanyWhiteLabelSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 21, 897, DateTimeKind.Utc).AddTicks(8351),
Value = new byte[] { 245, 71, 4, 138, 72, 101, 23, 21, 135, 217, 206, 188, 138, 73, 108, 96, 29, 150, 3, 31, 44, 28, 62, 145, 96, 53, 57, 66, 238, 118, 93, 172, 211, 22, 244, 181, 244, 40, 146, 67, 111, 196, 162, 27, 154, 109, 248, 255, 211, 188, 64, 54, 180, 126, 58, 90, 27, 76, 136, 27, 38, 96, 152, 105, 254, 187, 104, 72, 189, 136, 192, 46, 234, 198, 164, 204, 179, 232, 244, 4, 41, 8, 18, 240, 230, 225, 36, 165, 82, 190, 129, 165, 140, 100, 187, 139, 211, 201, 168, 192, 237, 225, 249, 66, 18, 129, 222, 12, 122, 248, 39, 51, 164, 188, 229, 21, 232, 86, 148, 196, 221, 167, 142, 34, 101, 43, 162, 137, 31, 206, 149, 120, 249, 114, 133, 168, 30, 18, 254, 223, 93, 101, 88, 97, 30, 58, 163, 224, 62, 173, 220, 170, 152, 40, 124, 100, 165, 81, 7, 87, 168, 129, 176, 12, 51, 69, 230, 252, 30, 34, 182, 7, 202, 45, 117, 60, 99, 241, 237, 148, 201, 35, 102, 219, 160, 228, 194, 230, 219, 22, 244, 74, 138, 176, 145, 0, 122, 167, 80, 93, 23, 228, 21, 48, 100, 60, 31, 250, 232, 34, 248, 249, 159, 210, 227, 12, 13, 239, 130, 223, 101, 196, 51, 36, 80, 127, 62, 92, 104, 228, 197, 226, 43, 232, 164, 12, 36, 66, 52, 133 }
},
new
{
Tenant = -1,
Id = "FullTextSearchSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 21, 897, DateTimeKind.Utc).AddTicks(8555),
Value = new byte[] { 8, 120, 207, 5, 153, 181, 23, 202, 162, 211, 218, 237, 157, 6, 76, 62, 220, 238, 175, 67, 31, 53, 166, 246, 66, 220, 173, 160, 72, 23, 227, 81, 50, 39, 187, 177, 222, 110, 43, 171, 235, 158, 16, 119, 178, 207, 49, 140, 72, 152, 20, 84, 94, 135, 117, 1, 246, 51, 251, 190, 148, 2, 44, 252, 221, 2, 91, 83, 149, 151, 58, 245, 16, 148, 52, 8, 187, 86, 150, 46, 227, 93, 163, 95, 47, 131, 116, 207, 95, 209, 38, 149, 53, 148, 73, 215, 206, 251, 194, 199, 189, 17, 42, 229, 135, 82, 23, 154, 162, 165, 158, 94, 23, 128, 30, 88, 12, 204, 96, 250, 236, 142, 189, 211, 214, 18, 196, 136, 102, 102, 217, 109, 108, 240, 96, 96, 94, 100, 201, 10, 31, 170, 128, 192 }
},
new
{
Tenant = -1,
Id = "SmtpSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 21, 897, DateTimeKind.Utc).AddTicks(8559),
Value = new byte[] { 240, 82, 224, 144, 161, 163, 117, 13, 173, 205, 78, 153, 97, 218, 4, 170, 81, 239, 1, 151, 226, 192, 98, 60, 241, 44, 88, 56, 191, 164, 10, 155, 72, 186, 239, 203, 227, 113, 88, 119, 49, 215, 227, 220, 158, 124, 96, 9, 116, 47, 158, 65, 93, 86, 219, 15, 10, 224, 142, 50, 248, 144, 75, 44, 68, 28, 198, 87, 198, 69, 67, 234, 238, 38, 32, 68, 162, 139, 67, 53, 220, 176, 240, 196, 233, 64, 29, 137, 31, 160, 99, 105, 249, 132, 202, 45, 71, 92, 134, 194, 55, 145, 121, 97, 197, 130, 119, 105, 131, 21, 133, 35, 10, 102, 172, 119, 135, 230, 251, 86, 253, 62, 55, 56, 146, 103, 164, 106 }
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Alias")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("alias")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Calls")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("calls")
.HasDefaultValueSql("true");
b.Property<DateTime>("CreationDateTime")
.HasColumnType("datetime")
.HasColumnName("creationdatetime");
b.Property<int?>("Industry")
.HasColumnType("int")
.HasColumnName("industry");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("char(10)")
.HasColumnName("language")
.HasDefaultValueSql("'en-US'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("MappedDomain")
.HasColumnType("varchar(100)")
.HasColumnName("mappeddomain")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("owner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PaymentId")
.HasColumnType("varchar(38)")
.HasColumnName("payment_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Spam")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("spam")
.HasDefaultValueSql("true");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<DateTime?>("StatusChanged")
.HasColumnType("datetime")
.HasColumnName("statuschanged");
b.Property<string>("TimeZone")
.HasColumnType("varchar(50)")
.HasColumnName("timezone")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TrustedDomains")
.HasColumnType("varchar(1024)")
.HasColumnName("trusteddomains")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TrustedDomainsEnabled")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("trusteddomainsenabled")
.HasDefaultValueSql("'1'");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("version")
.HasDefaultValueSql("'2'");
b.Property<DateTime?>("Version_Changed")
.HasColumnType("datetime")
.HasColumnName("version_changed");
b.HasKey("Id");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("MappedDomain")
.HasDatabaseName("mappeddomain");
b.HasIndex("Version")
.HasDatabaseName("version");
b.ToTable("tenants_tenants");
b.HasData(
new
{
Id = 1,
Alias = "localhost",
Calls = false,
CreationDateTime = new DateTime(2021, 8, 3, 21, 33, 10, 327, DateTimeKind.Utc).AddTicks(1400),
LastModified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Name = "Web Office",
OwnerId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
Spam = false,
Status = 0,
TrustedDomainsEnabled = 0,
Version = 0
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantForbiden", b =>
{
b.Property<string>("Address")
.HasColumnType("varchar(50)")
.HasColumnName("address")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Address")
.HasName("PRIMARY");
b.ToTable("tenants_forbiden");
b.HasData(
new
{
Address = "controlpanel"
},
new
{
Address = "localhost"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantPartner", b =>
{
b.Property<int>("TenantId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("AffiliateId")
.HasColumnType("varchar(50)")
.HasColumnName("affiliate_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Campaign")
.HasColumnType("varchar(50)")
.HasColumnName("campaign")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PartnerId")
.HasColumnType("varchar(36)")
.HasColumnName("partner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId")
.HasName("PRIMARY");
b.ToTable("tenants_partners");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantVersion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("DefaultVersion")
.HasColumnType("int")
.HasColumnName("default_version");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("version")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Visible")
.HasColumnType("tinyint(1)")
.HasColumnName("visible");
b.HasKey("Id");
b.ToTable("tenants_version");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.TenantIpRestrictions", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Ip")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("Id");
b.HasIndex("Tenant")
.HasDatabaseName("tenant");
b.ToTable("tenants_iprestrictions");
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.TenantDbContextMySql
{
[DbContext(typeof(MySqlTenantDbContext))]
partial class MySqlTenantDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbCoreSettings", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<string>("Id")
.HasColumnType("varchar(128)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<byte[]>("Value")
.IsRequired()
.HasColumnType("mediumblob")
.HasColumnName("value");
b.HasKey("Tenant", "Id")
.HasName("PRIMARY");
b.ToTable("core_settings");
b.HasData(
new
{
Tenant = -1,
Id = "CompanyWhiteLabelSettings",
LastModified = new DateTime(2021, 10, 26, 12, 11, 31, 504, DateTimeKind.Utc).AddTicks(1420),
Value = new byte[] { 245, 71, 4, 138, 72, 101, 23, 21, 135, 217, 206, 188, 138, 73, 108, 96, 29, 150, 3, 31, 44, 28, 62, 145, 96, 53, 57, 66, 238, 118, 93, 172, 211, 22, 244, 181, 244, 40, 146, 67, 111, 196, 162, 27, 154, 109, 248, 255, 211, 188, 64, 54, 180, 126, 58, 90, 27, 76, 136, 27, 38, 96, 152, 105, 254, 187, 104, 72, 189, 136, 192, 46, 234, 198, 164, 204, 179, 232, 244, 4, 41, 8, 18, 240, 230, 225, 36, 165, 82, 190, 129, 165, 140, 100, 187, 139, 211, 201, 168, 192, 237, 225, 249, 66, 18, 129, 222, 12, 122, 248, 39, 51, 164, 188, 229, 21, 232, 86, 148, 196, 221, 167, 142, 34, 101, 43, 162, 137, 31, 206, 149, 120, 249, 114, 133, 168, 30, 18, 254, 223, 93, 101, 88, 97, 30, 58, 163, 224, 62, 173, 220, 170, 152, 40, 124, 100, 165, 81, 7, 87, 168, 129, 176, 12, 51, 69, 230, 252, 30, 34, 182, 7, 202, 45, 117, 60, 99, 241, 237, 148, 201, 35, 102, 219, 160, 228, 194, 230, 219, 22, 244, 74, 138, 176, 145, 0, 122, 167, 80, 93, 23, 228, 21, 48, 100, 60, 31, 250, 232, 34, 248, 249, 159, 210, 227, 12, 13, 239, 130, 223, 101, 196, 51, 36, 80, 127, 62, 92, 104, 228, 197, 226, 43, 232, 164, 12, 36, 66, 52, 133 }
},
new
{
Tenant = -1,
Id = "FullTextSearchSettings",
LastModified = new DateTime(2021, 10, 26, 12, 11, 31, 504, DateTimeKind.Utc).AddTicks(1630),
Value = new byte[] { 8, 120, 207, 5, 153, 181, 23, 202, 162, 211, 218, 237, 157, 6, 76, 62, 220, 238, 175, 67, 31, 53, 166, 246, 66, 220, 173, 160, 72, 23, 227, 81, 50, 39, 187, 177, 222, 110, 43, 171, 235, 158, 16, 119, 178, 207, 49, 140, 72, 152, 20, 84, 94, 135, 117, 1, 246, 51, 251, 190, 148, 2, 44, 252, 221, 2, 91, 83, 149, 151, 58, 245, 16, 148, 52, 8, 187, 86, 150, 46, 227, 93, 163, 95, 47, 131, 116, 207, 95, 209, 38, 149, 53, 148, 73, 215, 206, 251, 194, 199, 189, 17, 42, 229, 135, 82, 23, 154, 162, 165, 158, 94, 23, 128, 30, 88, 12, 204, 96, 250, 236, 142, 189, 211, 214, 18, 196, 136, 102, 102, 217, 109, 108, 240, 96, 96, 94, 100, 201, 10, 31, 170, 128, 192 }
},
new
{
Tenant = -1,
Id = "SmtpSettings",
LastModified = new DateTime(2021, 10, 26, 12, 11, 31, 504, DateTimeKind.Utc).AddTicks(1635),
Value = new byte[] { 240, 82, 224, 144, 161, 163, 117, 13, 173, 205, 78, 153, 97, 218, 4, 170, 81, 239, 1, 151, 226, 192, 98, 60, 241, 44, 88, 56, 191, 164, 10, 155, 72, 186, 239, 203, 227, 113, 88, 119, 49, 215, 227, 220, 158, 124, 96, 9, 116, 47, 158, 65, 93, 86, 219, 15, 10, 224, 142, 50, 248, 144, 75, 44, 68, 28, 198, 87, 198, 69, 67, 234, 238, 38, 32, 68, 162, 139, 67, 53, 220, 176, 240, 196, 233, 64, 29, 137, 31, 160, 99, 105, 249, 132, 202, 45, 71, 92, 134, 194, 55, 145, 121, 97, 197, 130, 119, 105, 131, 21, 133, 35, 10, 102, 172, 119, 135, 230, 251, 86, 253, 62, 55, 56, 146, 103, 164, 106 }
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Alias")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("alias")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Calls")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("calls")
.HasDefaultValueSql("true");
b.Property<DateTime>("CreationDateTime")
.HasColumnType("datetime")
.HasColumnName("creationdatetime");
b.Property<int?>("Industry")
.HasColumnType("int")
.HasColumnName("industry");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("char(10)")
.HasColumnName("language")
.HasDefaultValueSql("'en-US'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("MappedDomain")
.HasColumnType("varchar(100)")
.HasColumnName("mappeddomain")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("owner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PaymentId")
.HasColumnType("varchar(38)")
.HasColumnName("payment_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Spam")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("spam")
.HasDefaultValueSql("true");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<DateTime?>("StatusChanged")
.HasColumnType("datetime")
.HasColumnName("statuschanged");
b.Property<string>("TimeZone")
.HasColumnType("varchar(50)")
.HasColumnName("timezone")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TrustedDomains")
.HasColumnType("varchar(1024)")
.HasColumnName("trusteddomains")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TrustedDomainsEnabled")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("trusteddomainsenabled")
.HasDefaultValueSql("'1'");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("version")
.HasDefaultValueSql("'2'");
b.Property<DateTime?>("Version_Changed")
.HasColumnType("datetime")
.HasColumnName("version_changed");
b.HasKey("Id");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("MappedDomain")
.HasDatabaseName("mappeddomain");
b.HasIndex("Version")
.HasDatabaseName("version");
b.ToTable("tenants_tenants");
b.HasData(
new
{
Id = 1,
Alias = "localhost",
Calls = false,
CreationDateTime = new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317),
LastModified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Name = "Web Office",
OwnerId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
Spam = false,
Status = 0,
TrustedDomainsEnabled = 0,
Version = 0
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantForbiden", b =>
{
b.Property<string>("Address")
.HasColumnType("varchar(50)")
.HasColumnName("address")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Address")
.HasName("PRIMARY");
b.ToTable("tenants_forbiden");
b.HasData(
new
{
Address = "controlpanel"
},
new
{
Address = "localhost"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantPartner", b =>
{
b.Property<int>("TenantId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("AffiliateId")
.HasColumnType("varchar(50)")
.HasColumnName("affiliate_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Campaign")
.HasColumnType("varchar(50)")
.HasColumnName("campaign")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PartnerId")
.HasColumnType("varchar(36)")
.HasColumnName("partner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId")
.HasName("PRIMARY");
b.ToTable("tenants_partners");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantVersion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("DefaultVersion")
.HasColumnType("int")
.HasColumnName("default_version");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("version")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Visible")
.HasColumnType("tinyint(1)")
.HasColumnName("visible");
b.HasKey("Id");
b.ToTable("tenants_version");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.TenantIpRestrictions", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Ip")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("Id");
b.HasIndex("Tenant")
.HasDatabaseName("tenant");
b.ToTable("tenants_iprestrictions");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,288 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.VoipDbContextMySql
{
[DbContext(typeof(MySqlVoipDbContext))]
[Migration("20211012145344_VoipDbContextMySql")]
partial class VoipDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.CrmContact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("CompanyId")
.HasColumnType("int")
.HasColumnName("company_id");
b.Property<string>("CompanyName")
.HasColumnType("varchar(255)")
.HasColumnName("company_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("ContactTypeId")
.HasColumnType("int")
.HasColumnName("contact_type_id");
b.Property<string>("CreateBy")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("create_by")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreateOn")
.HasColumnType("datetime")
.HasColumnName("create_on");
b.Property<string>("Currency")
.HasColumnType("varchar(3)")
.HasColumnName("currency")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("DisplayName")
.HasColumnType("varchar(255)")
.HasColumnName("display_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("FirstName")
.HasColumnType("varchar(255)")
.HasColumnName("first_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Industry")
.HasColumnType("varchar(255)")
.HasColumnName("industry")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("IsCompany")
.HasColumnType("tinyint(1)")
.HasColumnName("is_company");
b.Property<bool>("IsShared")
.HasColumnType("tinyint(1)")
.HasColumnName("is_shared");
b.Property<string>("LastModifedBy")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("last_modifed_by")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModifedOn")
.HasColumnType("datetime")
.HasColumnName("last_modifed_on");
b.Property<string>("LastName")
.HasColumnType("varchar(255)")
.HasColumnName("last_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Notes")
.HasColumnType("text")
.HasColumnName("notes")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("StatusId")
.HasColumnType("int")
.HasColumnName("status_id");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("Title")
.HasColumnType("varchar(255)")
.HasColumnName("title")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("CreateOn")
.HasDatabaseName("create_on");
b.HasIndex("LastModifedOn", "TenantId")
.HasDatabaseName("last_modifed_on");
b.HasIndex("TenantId", "CompanyId")
.HasDatabaseName("company_id");
b.HasIndex("TenantId", "DisplayName")
.HasDatabaseName("display_name");
b.ToTable("crm_contact");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbVoipCall", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(50)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("AnsweredBy")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("varchar(50)")
.HasColumnName("answered_by")
.HasDefaultValueSql("'00000000-0000-0000-0000-000000000000'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("ContactId")
.HasColumnType("int")
.HasColumnName("contact_id");
b.Property<int?>("CrmContactId")
.HasColumnType("int");
b.Property<DateTime>("DialDate")
.HasColumnType("datetime")
.HasColumnName("dial_date");
b.Property<int>("DialDuration")
.HasColumnType("int")
.HasColumnName("dial_duration");
b.Property<string>("NumberFrom")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("number_from")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("NumberTo")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("number_to")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ParentCallId")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("parent_call_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<decimal>("Price")
.HasColumnType("decimal(10,4)")
.HasColumnName("price");
b.Property<int>("RecordDuration")
.HasColumnType("int")
.HasColumnName("record_duration");
b.Property<decimal>("RecordPrice")
.HasColumnType("decimal(10,4)")
.HasColumnName("record_price");
b.Property<string>("RecordSid")
.HasColumnType("varchar(50)")
.HasColumnName("record_sid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("RecordUrl")
.HasColumnType("text")
.HasColumnName("record_url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.HasKey("Id");
b.HasIndex("CrmContactId");
b.HasIndex("TenantId")
.HasDatabaseName("tenant_id");
b.HasIndex("ParentCallId", "TenantId")
.HasDatabaseName("parent_call_id");
b.ToTable("crm_voip_calls");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.VoipNumber", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(50)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Alias")
.HasColumnType("varchar(255)")
.HasColumnName("alias")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Number")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("number")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Settings")
.HasColumnType("text")
.HasColumnName("settings")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.HasKey("Id");
b.HasIndex("TenantId")
.HasDatabaseName("tenant_id");
b.ToTable("crm_voip_number");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbVoipCall", b =>
{
b.HasOne("ASC.Core.Common.EF.Model.CrmContact", "CrmContact")
.WithMany()
.HasForeignKey("CrmContactId");
b.Navigation("CrmContact");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,168 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.VoipDbContextMySql
{
public partial class VoipDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "crm_contact",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
tenant_id = table.Column<int>(type: "int", nullable: false),
is_company = table.Column<bool>(type: "tinyint(1)", nullable: false),
notes = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
title = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
first_name = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
last_name = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
company_name = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
industry = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
status_id = table.Column<int>(type: "int", nullable: false),
company_id = table.Column<int>(type: "int", nullable: false),
contact_type_id = table.Column<int>(type: "int", nullable: false),
create_by = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
create_on = table.Column<DateTime>(type: "datetime", nullable: false),
last_modifed_by = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
last_modifed_on = table.Column<DateTime>(type: "datetime", nullable: false),
display_name = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
is_shared = table.Column<bool>(type: "tinyint(1)", nullable: false),
currency = table.Column<string>(type: "varchar(3)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PK_crm_contact", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "crm_voip_number",
columns: table => new
{
id = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
number = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
alias = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
settings = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
tenant_id = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_crm_voip_number", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "crm_voip_calls",
columns: table => new
{
id = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
parent_call_id = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
number_from = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
number_to = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
status = table.Column<int>(type: "int", nullable: false),
answered_by = table.Column<string>(type: "varchar(50)", nullable: false, defaultValueSql: "'00000000-0000-0000-0000-000000000000'", collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
dial_date = table.Column<DateTime>(type: "datetime", nullable: false),
dial_duration = table.Column<int>(type: "int", nullable: false),
record_sid = table.Column<string>(type: "varchar(50)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
record_url = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
record_duration = table.Column<int>(type: "int", nullable: false),
record_price = table.Column<decimal>(type: "decimal(10,4)", nullable: false),
contact_id = table.Column<int>(type: "int", nullable: false),
price = table.Column<decimal>(type: "decimal(10,4)", nullable: false),
tenant_id = table.Column<int>(type: "int", nullable: false),
CrmContactId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_crm_voip_calls", x => x.id);
table.ForeignKey(
name: "FK_crm_voip_calls_crm_contact_CrmContactId",
column: x => x.CrmContactId,
principalTable: "crm_contact",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "company_id",
table: "crm_contact",
columns: new[] { "tenant_id", "company_id" });
migrationBuilder.CreateIndex(
name: "create_on",
table: "crm_contact",
column: "create_on");
migrationBuilder.CreateIndex(
name: "display_name",
table: "crm_contact",
columns: new[] { "tenant_id", "display_name" });
migrationBuilder.CreateIndex(
name: "last_modifed_on",
table: "crm_contact",
columns: new[] { "last_modifed_on", "tenant_id" });
migrationBuilder.CreateIndex(
name: "IX_crm_voip_calls_CrmContactId",
table: "crm_voip_calls",
column: "CrmContactId");
migrationBuilder.CreateIndex(
name: "parent_call_id",
table: "crm_voip_calls",
columns: new[] { "parent_call_id", "tenant_id" });
migrationBuilder.CreateIndex(
name: "tenant_id",
table: "crm_voip_calls",
column: "tenant_id");
migrationBuilder.CreateIndex(
name: "tenant_id",
table: "crm_voip_number",
column: "tenant_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "crm_voip_calls");
migrationBuilder.DropTable(
name: "crm_voip_number");
migrationBuilder.DropTable(
name: "crm_contact");
}
}
}

View File

@ -0,0 +1,129 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.WebstudioDbContextMySql
{
[DbContext(typeof(MySqlWebstudioDbContext))]
[Migration("20211012145346_WebstudioDbContextMySql")]
partial class WebstudioDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioIndex", b =>
{
b.Property<string>("IndexName")
.HasColumnType("varchar(50)")
.HasColumnName("index_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.HasKey("IndexName")
.HasName("PRIMARY");
b.ToTable("webstudio_index");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioSettings", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("TenantID");
b.Property<string>("Id")
.HasColumnType("varchar(64)")
.HasColumnName("ID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("varchar(64)")
.HasColumnName("UserID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Data")
.IsRequired()
.HasColumnType("mediumtext")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId", "Id", "UserId")
.HasName("PRIMARY");
b.HasIndex("Id")
.HasDatabaseName("ID");
b.ToTable("webstudio_settings");
b.HasData(
new
{
TenantId = 1,
Id = "9a925891-1f92-4ed7-b277-d6f649739f06",
UserId = "00000000-0000-0000-0000-000000000000",
Data = "{\"Completed\":false}"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioUserVisit", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenantid");
b.Property<DateTime>("VisitDate")
.HasColumnType("datetime")
.HasColumnName("visitdate");
b.Property<string>("ProductId")
.HasColumnType("varchar(38)")
.HasColumnName("productid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("varchar(38)")
.HasColumnName("userid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("FirstVisitTime")
.HasColumnType("datetime")
.HasColumnName("firstvisittime");
b.Property<DateTime>("LastVisitTime")
.HasColumnType("datetime")
.HasColumnName("lastvisittime");
b.Property<int>("VisitCount")
.HasColumnType("int")
.HasColumnName("visitcount");
b.HasKey("TenantId", "VisitDate", "ProductId", "UserId")
.HasName("PRIMARY");
b.HasIndex("VisitDate")
.HasDatabaseName("visitdate");
b.ToTable("webstudio_uservisit");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,94 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.MySql.WebstudioDbContextMySql
{
public partial class WebstudioDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "webstudio_index",
columns: table => new
{
index_name = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
last_modified = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.index_name);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "webstudio_settings",
columns: table => new
{
TenantID = table.Column<int>(type: "int", nullable: false),
ID = table.Column<string>(type: "varchar(64)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
UserID = table.Column<string>(type: "varchar(64)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
Data = table.Column<string>(type: "mediumtext", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.TenantID, x.ID, x.UserID });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "webstudio_uservisit",
columns: table => new
{
tenantid = table.Column<int>(type: "int", nullable: false),
visitdate = table.Column<DateTime>(type: "datetime", nullable: false),
productid = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
userid = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
visitcount = table.Column<int>(type: "int", nullable: false),
firstvisittime = table.Column<DateTime>(type: "datetime", nullable: false),
lastvisittime = table.Column<DateTime>(type: "datetime", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenantid, x.visitdate, x.productid, x.userid });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "webstudio_settings",
columns: new[] { "ID", "TenantID", "UserID", "Data" },
values: new object[] { "9a925891-1f92-4ed7-b277-d6f649739f06", 1, "00000000-0000-0000-0000-000000000000", "{\"Completed\":false}" });
migrationBuilder.CreateIndex(
name: "ID",
table: "webstudio_settings",
column: "ID");
migrationBuilder.CreateIndex(
name: "visitdate",
table: "webstudio_uservisit",
column: "visitdate");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "webstudio_index");
migrationBuilder.DropTable(
name: "webstudio_settings");
migrationBuilder.DropTable(
name: "webstudio_uservisit");
}
}
}

View File

@ -1,97 +1,100 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.MySql.MessagesContextMySql
{
[DbContext(typeof(MySqlMessagesContext))]
[Migration("20210803212546_MessagesContextMySql")]
partial class MessagesContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(500)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
b.Property<string>("Login")
.HasColumnType("varchar(200)")
.HasColumnName("login")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasCharSet("utf8");
b.HasKey("Id");
b.HasIndex("Date")
.HasDatabaseName("date");
b.HasIndex("TenantId", "UserId")
.HasDatabaseName("tenant_id");
b.ToTable("login_events");
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.AuditTrailContextPostgreSql
{
[DbContext(typeof(PostgreSqlAuditTrailContext))]
[Migration("20211026120319_AuditTrailContextPostgreSql")]
partial class AuditTrailContextPostgreSql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.AuditEvent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(20000)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Initiator")
.HasColumnType("varchar(200)")
.HasColumnName("initiator")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Target")
.HasColumnType("text")
.HasColumnName("target")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("TenantId", "Date")
.HasDatabaseName("date");
b.ToTable("audit_events");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,58 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Core.Common.Migrations.PostgreSql.AuditTrailContextPostgreSql
{
public partial class AuditTrailContextPostgreSql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "audit_events",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
initiator = table.Column<string>(type: "varchar(200)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
target = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
ip = table.Column<string>(type: "varchar(50)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
browser = table.Column<string>(type: "varchar(200)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
platform = table.Column<string>(type: "varchar(200)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
date = table.Column<DateTime>(type: "datetime", nullable: false),
tenant_id = table.Column<int>(type: "int", nullable: false),
user_id = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
page = table.Column<string>(type: "varchar(300)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
action = table.Column<int>(type: "int", nullable: false),
description = table.Column<string>(type: "varchar(20000)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PK_audit_events", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "date",
table: "audit_events",
columns: new[] { "tenant_id", "date" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "audit_events");
}
}
}

View File

@ -0,0 +1,98 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.AuditTrailContextPostgreSql
{
[DbContext(typeof(PostgreSqlAuditTrailContext))]
partial class PostgreSqlAuditTrailContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.AuditEvent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(20000)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Initiator")
.HasColumnType("varchar(200)")
.HasColumnName("initiator")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Target")
.HasColumnType("text")
.HasColumnName("target")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("TenantId", "Date")
.HasDatabaseName("date");
b.ToTable("audit_events");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,4 +1,5 @@
using System;
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
@ -11,25 +12,6 @@ namespace ASC.Core.Common.Migrations.PostgreSql.CoreDbContextPostgreSql
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "core_acl",
columns: table => new
{
tenant = table.Column<int>(type: "int", nullable: false),
subject = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
action = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
@object = table.Column<string>(name: "object", type: "varchar(255)", nullable: false, defaultValueSql: "''", collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
acetype = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenant, x.subject, x.action, x.@object });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tenants_buttons",
columns: table => new

View File

@ -1,198 +1,198 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.CoreDbContextPostgreSql
{
[DbContext(typeof(PostgreSqlCoreDbContext))]
partial class PostgreSqlCoreDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.DbButton", b =>
{
b.Property<int>("TariffId")
.HasColumnType("int")
.HasColumnName("tariff_id");
b.Property<string>("PartnerId")
.HasColumnType("varchar(50)")
.HasColumnName("partner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ButtonUrl")
.IsRequired()
.HasColumnType("text")
.HasColumnName("button_url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TariffId", "PartnerId")
.HasName("PRIMARY");
b.ToTable("tenants_buttons");
});
modelBuilder.Entity("ASC.Core.Common.EF.DbQuota", b =>
{
b.Property<int>("Tenant")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<int>("ActiveUsers")
.HasColumnType("int")
.HasColumnName("active_users");
b.Property<string>("AvangateId")
.HasColumnType("varchar(128)")
.HasColumnName("avangate_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Description")
.HasColumnType("varchar(128)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Features")
.HasColumnType("text")
.HasColumnName("features")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<long>("MaxFileSize")
.HasColumnType("bigint")
.HasColumnName("max_file_size");
b.Property<long>("MaxTotalSize")
.HasColumnType("bigint")
.HasColumnName("max_total_size");
b.Property<string>("Name")
.HasColumnType("varchar(128)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<decimal>("Price")
.HasColumnType("decimal(10,2)")
.HasColumnName("price");
b.Property<bool>("Visible")
.HasColumnType("tinyint(1)")
.HasColumnName("visible");
b.HasKey("Tenant")
.HasName("PRIMARY");
b.ToTable("tenants_quota");
b.HasData(
new
{
Tenant = -1,
ActiveUsers = 10000,
AvangateId = "0",
Features = "domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom,restore",
MaxFileSize = 102400L,
MaxTotalSize = 10995116277760L,
Name = "default",
Price = 0.00m,
Visible = false
});
});
modelBuilder.Entity("ASC.Core.Common.EF.DbQuotaRow", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<string>("Path")
.HasColumnType("varchar(255)")
.HasColumnName("path")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<long>("Counter")
.HasColumnType("bigint")
.HasColumnName("counter");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("Tag")
.HasColumnType("varchar(1024)")
.HasColumnName("tag")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Tenant", "Path")
.HasName("PRIMARY");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.ToTable("tenants_quotarow");
});
modelBuilder.Entity("ASC.Core.Common.EF.DbTariff", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Comment")
.HasColumnType("varchar(255)")
.HasColumnName("comment")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreateOn")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("create_on")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<int>("Quantity")
.HasColumnType("int")
.HasColumnName("quantity");
b.Property<DateTime>("Stamp")
.HasColumnType("datetime")
.HasColumnName("stamp");
b.Property<int>("Tariff")
.HasColumnType("int")
.HasColumnName("tariff");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("Id");
b.HasIndex("Tenant")
.HasDatabaseName("tenant");
b.ToTable("tenants_tariff");
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using ASC.Core.Common.EF;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.CoreDbContextPostgreSql
{
[DbContext(typeof(PostgreSqlCoreDbContext))]
partial class PostgreSqlCoreDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.DbButton", b =>
{
b.Property<int>("TariffId")
.HasColumnType("int")
.HasColumnName("tariff_id");
b.Property<string>("PartnerId")
.HasColumnType("varchar(50)")
.HasColumnName("partner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("ButtonUrl")
.IsRequired()
.HasColumnType("text")
.HasColumnName("button_url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TariffId", "PartnerId")
.HasName("PRIMARY");
b.ToTable("tenants_buttons");
});
modelBuilder.Entity("ASC.Core.Common.EF.DbQuota", b =>
{
b.Property<int>("Tenant")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<int>("ActiveUsers")
.HasColumnType("int")
.HasColumnName("active_users");
b.Property<string>("AvangateId")
.HasColumnType("varchar(128)")
.HasColumnName("avangate_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Description")
.HasColumnType("varchar(128)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Features")
.HasColumnType("text")
.HasColumnName("features")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<long>("MaxFileSize")
.HasColumnType("bigint")
.HasColumnName("max_file_size");
b.Property<long>("MaxTotalSize")
.HasColumnType("bigint")
.HasColumnName("max_total_size");
b.Property<string>("Name")
.HasColumnType("varchar(128)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<decimal>("Price")
.HasColumnType("decimal(10,2)")
.HasColumnName("price");
b.Property<bool>("Visible")
.HasColumnType("tinyint(1)")
.HasColumnName("visible");
b.HasKey("Tenant")
.HasName("PRIMARY");
b.ToTable("tenants_quota");
b.HasData(
new
{
Tenant = -1,
ActiveUsers = 10000,
AvangateId = "0",
Features = "domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom,restore",
MaxFileSize = 102400L,
MaxTotalSize = 10995116277760L,
Name = "default",
Price = 0.00m,
Visible = false
});
});
modelBuilder.Entity("ASC.Core.Common.EF.DbQuotaRow", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<string>("Path")
.HasColumnType("varchar(255)")
.HasColumnName("path")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<long>("Counter")
.HasColumnType("bigint")
.HasColumnName("counter");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("Tag")
.HasColumnType("varchar(1024)")
.HasColumnName("tag")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Tenant", "Path")
.HasName("PRIMARY");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.ToTable("tenants_quotarow");
});
modelBuilder.Entity("ASC.Core.Common.EF.DbTariff", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Comment")
.HasColumnType("varchar(255)")
.HasColumnName("comment")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreateOn")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("create_on")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<int>("Quantity")
.HasColumnType("int")
.HasColumnName("quantity");
b.Property<DateTime>("Stamp")
.HasColumnType("datetime")
.HasColumnName("stamp");
b.Property<int>("Tariff")
.HasColumnType("int")
.HasColumnName("tariff");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("Id");
b.HasIndex("Tenant")
.HasDatabaseName("tenant");
b.ToTable("tenants_tariff");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -95,6 +95,189 @@ namespace ASC.Core.Common.Migrations.PostgreSql.MessagesContextPostgreSql
b.ToTable("audit_events");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Alias")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("alias")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Calls")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("calls")
.HasDefaultValueSql("true");
b.Property<DateTime>("CreationDateTime")
.HasColumnType("datetime")
.HasColumnName("creationdatetime");
b.Property<int?>("Industry")
.HasColumnType("int")
.HasColumnName("industry");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("char(10)")
.HasColumnName("language")
.HasDefaultValueSql("'en-US'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("MappedDomain")
.HasColumnType("varchar(100)")
.HasColumnName("mappeddomain")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("owner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PaymentId")
.HasColumnType("varchar(38)")
.HasColumnName("payment_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Spam")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("spam")
.HasDefaultValueSql("true");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<DateTime?>("StatusChanged")
.HasColumnType("datetime")
.HasColumnName("statuschanged");
b.Property<string>("TimeZone")
.HasColumnType("varchar(50)")
.HasColumnName("timezone")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TrustedDomains")
.HasColumnType("varchar(1024)")
.HasColumnName("trusteddomains")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TrustedDomainsEnabled")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("trusteddomainsenabled")
.HasDefaultValueSql("'1'");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("version")
.HasDefaultValueSql("'2'");
b.Property<DateTime?>("Version_Changed")
.HasColumnType("datetime")
.HasColumnName("version_changed");
b.HasKey("Id");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("MappedDomain")
.HasDatabaseName("mappeddomain");
b.HasIndex("Version")
.HasDatabaseName("version");
b.ToTable("tenants_tenants");
b.HasData(
new
{
Id = 1,
Alias = "localhost",
Calls = false,
CreationDateTime = new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317),
LastModified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Name = "Web Office",
OwnerId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
Spam = false,
Status = 0,
TrustedDomainsEnabled = 0,
Version = 0
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioSettings", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("TenantID");
b.Property<string>("Id")
.HasColumnType("varchar(64)")
.HasColumnName("ID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("varchar(64)")
.HasColumnName("UserID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Data")
.IsRequired()
.HasColumnType("mediumtext")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId", "Id", "UserId")
.HasName("PRIMARY");
b.HasIndex("Id")
.HasDatabaseName("ID");
b.ToTable("webstudio_settings");
b.HasData(
new
{
TenantId = 1,
Id = "9a925891-1f92-4ed7-b277-d6f649739f06",
UserId = "00000000-0000-0000-0000-000000000000",
Data = "{'Completed':false}"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b =>
{
b.Property<int>("Id")

View File

@ -1,171 +1,95 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.MessagesContextPostgreSql
{
[DbContext(typeof(PostgreSqlMessagesContext))]
partial class PostgreSqlMessagesContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.AuditEvent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(20000)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Initiator")
.HasColumnType("varchar(200)")
.HasColumnName("initiator")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Target")
.HasColumnType("text")
.HasColumnName("target")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("TenantId", "Date")
.HasDatabaseName("date");
b.ToTable("audit_events");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(500)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Login")
.HasColumnType("varchar(200)")
.HasColumnName("login")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("Date")
.HasDatabaseName("date");
b.HasIndex("TenantId", "UserId")
.HasDatabaseName("tenant_id");
b.ToTable("login_events");
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.MessagesContextPostgreSql
{
[DbContext(typeof(PostgreSqlMessagesContext))]
partial class PostgreSqlMessagesContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.LoginEvents", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Action")
.HasColumnType("int")
.HasColumnName("action");
b.Property<string>("Browser")
.HasColumnType("varchar(200)")
.HasColumnName("browser")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("Date")
.HasColumnType("datetime")
.HasColumnName("date");
b.Property<string>("Description")
.HasColumnType("varchar(500)")
.HasColumnName("description")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Ip")
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Login")
.HasColumnType("varchar(200)")
.HasColumnName("login")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Page")
.HasColumnType("varchar(300)")
.HasColumnName("page")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Platform")
.HasColumnType("varchar(200)")
.HasColumnName("platform")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("Date")
.HasDatabaseName("date");
b.HasIndex("TenantId", "UserId")
.HasDatabaseName("tenant_id");
b.ToTable("login_events");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,619 +1,330 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.TenantDbContextPostgreSql
{
[DbContext(typeof(PostgreSqlTenantDbContext))]
partial class PostgreSqlTenantDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbCoreSettings", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<string>("Id")
.HasColumnType("varchar(128)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<byte[]>("Value")
.IsRequired()
.HasColumnType("mediumblob")
.HasColumnName("value");
b.HasKey("Tenant", "Id")
.HasName("PRIMARY");
b.ToTable("core_settings");
b.HasData(
new
{
Tenant = -1,
Id = "CompanyWhiteLabelSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 22, 50, DateTimeKind.Utc).AddTicks(4300),
Value = new byte[] { 245, 71, 4, 138, 72, 101, 23, 21, 135, 217, 206, 188, 138, 73, 108, 96, 29, 150, 3, 31, 44, 28, 62, 145, 96, 53, 57, 66, 238, 118, 93, 172, 211, 22, 244, 181, 244, 40, 146, 67, 111, 196, 162, 27, 154, 109, 248, 255, 211, 188, 64, 54, 180, 126, 58, 90, 27, 76, 136, 27, 38, 96, 152, 105, 254, 187, 104, 72, 189, 136, 192, 46, 234, 198, 164, 204, 179, 232, 244, 4, 41, 8, 18, 240, 230, 225, 36, 165, 82, 190, 129, 165, 140, 100, 187, 139, 211, 201, 168, 192, 237, 225, 249, 66, 18, 129, 222, 12, 122, 248, 39, 51, 164, 188, 229, 21, 232, 86, 148, 196, 221, 167, 142, 34, 101, 43, 162, 137, 31, 206, 149, 120, 249, 114, 133, 168, 30, 18, 254, 223, 93, 101, 88, 97, 30, 58, 163, 224, 62, 173, 220, 170, 152, 40, 124, 100, 165, 81, 7, 87, 168, 129, 176, 12, 51, 69, 230, 252, 30, 34, 182, 7, 202, 45, 117, 60, 99, 241, 237, 148, 201, 35, 102, 219, 160, 228, 194, 230, 219, 22, 244, 74, 138, 176, 145, 0, 122, 167, 80, 93, 23, 228, 21, 48, 100, 60, 31, 250, 232, 34, 248, 249, 159, 210, 227, 12, 13, 239, 130, 223, 101, 196, 51, 36, 80, 127, 62, 92, 104, 228, 197, 226, 43, 232, 164, 12, 36, 66, 52, 133 }
},
new
{
Tenant = -1,
Id = "FullTextSearchSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 22, 50, DateTimeKind.Utc).AddTicks(4317),
Value = new byte[] { 8, 120, 207, 5, 153, 181, 23, 202, 162, 211, 218, 237, 157, 6, 76, 62, 220, 238, 175, 67, 31, 53, 166, 246, 66, 220, 173, 160, 72, 23, 227, 81, 50, 39, 187, 177, 222, 110, 43, 171, 235, 158, 16, 119, 178, 207, 49, 140, 72, 152, 20, 84, 94, 135, 117, 1, 246, 51, 251, 190, 148, 2, 44, 252, 221, 2, 91, 83, 149, 151, 58, 245, 16, 148, 52, 8, 187, 86, 150, 46, 227, 93, 163, 95, 47, 131, 116, 207, 95, 209, 38, 149, 53, 148, 73, 215, 206, 251, 194, 199, 189, 17, 42, 229, 135, 82, 23, 154, 162, 165, 158, 94, 23, 128, 30, 88, 12, 204, 96, 250, 236, 142, 189, 211, 214, 18, 196, 136, 102, 102, 217, 109, 108, 240, 96, 96, 94, 100, 201, 10, 31, 170, 128, 192 }
},
new
{
Tenant = -1,
Id = "SmtpSettings",
LastModified = new DateTime(2021, 10, 12, 14, 53, 22, 50, DateTimeKind.Utc).AddTicks(4321),
Value = new byte[] { 240, 82, 224, 144, 161, 163, 117, 13, 173, 205, 78, 153, 97, 218, 4, 170, 81, 239, 1, 151, 226, 192, 98, 60, 241, 44, 88, 56, 191, 164, 10, 155, 72, 186, 239, 203, 227, 113, 88, 119, 49, 215, 227, 220, 158, 124, 96, 9, 116, 47, 158, 65, 93, 86, 219, 15, 10, 224, 142, 50, 248, 144, 75, 44, 68, 28, 198, 87, 198, 69, 67, 234, 238, 38, 32, 68, 162, 139, 67, 53, 220, 176, 240, 196, 233, 64, 29, 137, 31, 160, 99, 105, 249, 132, 202, 45, 71, 92, 134, 194, 55, 145, 121, 97, 197, 130, 119, 105, 131, 21, 133, 35, 10, 102, 172, 119, 135, 230, 251, 86, 253, 62, 55, 56, 146, 103, 164, 106 }
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Alias")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("alias")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Calls")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("calls")
.HasDefaultValueSql("true");
b.Property<DateTime>("CreationDateTime")
.HasColumnType("datetime")
.HasColumnName("creationdatetime");
b.Property<int?>("Industry")
.HasColumnType("int")
.HasColumnName("industry");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("char(10)")
.HasColumnName("language")
.HasDefaultValueSql("'en-US'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("MappedDomain")
.HasColumnType("varchar(100)")
.HasColumnName("mappeddomain")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("owner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PaymentId")
.HasColumnType("varchar(38)")
.HasColumnName("payment_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Spam")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("spam")
.HasDefaultValueSql("true");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<DateTime?>("StatusChanged")
.HasColumnType("datetime")
.HasColumnName("statuschanged");
b.Property<string>("TimeZone")
.HasColumnType("varchar(50)")
.HasColumnName("timezone")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TrustedDomains")
.HasColumnType("varchar(1024)")
.HasColumnName("trusteddomains")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TrustedDomainsEnabled")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("trusteddomainsenabled")
.HasDefaultValueSql("'1'");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("version")
.HasDefaultValueSql("'2'");
b.Property<DateTime?>("Version_Changed")
.HasColumnType("datetime")
.HasColumnName("version_changed");
b.HasKey("Id");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("MappedDomain")
.HasDatabaseName("mappeddomain");
b.HasIndex("Version")
.HasDatabaseName("version");
b.ToTable("tenants_tenants");
b.HasData(
new
{
Id = 1,
Alias = "localhost",
Calls = false,
CreationDateTime = new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317),
LastModified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Name = "Web Office",
OwnerId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
Spam = false,
Status = 0,
TrustedDomainsEnabled = 0,
Version = 0
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantForbiden", b =>
{
b.Property<string>("Address")
.HasColumnType("varchar(50)")
.HasColumnName("address")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Address")
.HasName("PRIMARY");
b.ToTable("tenants_forbiden");
b.HasData(
new
{
Address = "controlpanel"
},
new
{
Address = "localhost"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantPartner", b =>
{
b.Property<int>("TenantId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("AffiliateId")
.HasColumnType("varchar(50)")
.HasColumnName("affiliate_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Campaign")
.HasColumnType("varchar(50)")
.HasColumnName("campaign")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PartnerId")
.HasColumnType("varchar(36)")
.HasColumnName("partner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId")
.HasName("PRIMARY");
b.ToTable("tenants_partners");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantVersion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("DefaultVersion")
.HasColumnType("int")
.HasColumnName("default_version");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("version")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Visible")
.HasColumnType("tinyint(1)")
.HasColumnName("visible");
b.HasKey("Id");
b.ToTable("tenants_version");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.TenantIpRestrictions", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Ip")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("Id");
b.HasIndex("Tenant")
.HasDatabaseName("tenant");
b.ToTable("tenants_iprestrictions");
});
modelBuilder.Entity("ASC.Core.Common.EF.User", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("varchar(38)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("ActivationStatus")
.HasColumnType("int")
.HasColumnName("activation_status");
b.Property<DateTime?>("Birthdate")
.HasColumnType("datetime")
.HasColumnName("bithdate");
b.Property<string>("Contacts")
.HasColumnType("varchar(1024)")
.HasColumnName("contacts")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreateOn")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("create_on")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("Culture")
.HasColumnType("varchar(20)")
.HasColumnName("culture")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Email")
.HasColumnType("varchar(255)")
.HasColumnName("email")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("firstname")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.HasColumnType("datetime")
.HasColumnName("last_modified");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("lastname")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Location")
.HasColumnType("varchar(255)")
.HasColumnName("location")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Notes")
.HasColumnType("varchar(512)")
.HasColumnName("notes")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Phone")
.HasColumnType("varchar(255)")
.HasColumnName("phone")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("PhoneActivation")
.HasColumnType("int")
.HasColumnName("phone_activation");
b.Property<bool>("Removed")
.HasColumnType("tinyint(1)")
.HasColumnName("removed");
b.Property<bool?>("Sex")
.HasColumnType("tinyint(1)")
.HasColumnName("sex");
b.Property<string>("Sid")
.HasColumnType("varchar(512)")
.HasColumnName("sid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("SsoNameId")
.HasColumnType("varchar(512)")
.HasColumnName("sso_name_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("SsoSessionId")
.HasColumnType("varchar(512)")
.HasColumnName("sso_session_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("status")
.HasDefaultValueSql("'1'");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<DateTime?>("TerminatedDate")
.HasColumnType("datetime")
.HasColumnName("terminateddate");
b.Property<string>("Title")
.HasColumnType("varchar(64)")
.HasColumnName("title")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("username")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime?>("WorkFromDate")
.HasColumnType("datetime")
.HasColumnName("workfromdate");
b.HasKey("Id");
b.HasIndex("Email")
.HasDatabaseName("email");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("Tenant", "UserName")
.HasDatabaseName("username");
b.ToTable("core_user");
b.HasData(
new
{
Id = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
ActivationStatus = 0,
CreateOn = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Email = "",
FirstName = "Administrator",
LastModified = new DateTime(2021, 3, 9, 9, 52, 55, 765, DateTimeKind.Utc).AddTicks(1420),
LastName = "",
PhoneActivation = 0,
Removed = false,
Status = 1,
Tenant = 1,
UserName = "administrator",
WorkFromDate = new DateTime(2021, 3, 9, 9, 52, 55, 764, DateTimeKind.Utc).AddTicks(9157)
});
});
modelBuilder.Entity("ASC.Core.Common.EF.UserGroup", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<string>("UserId")
.HasColumnType("varchar(38)")
.HasColumnName("userid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("GroupId")
.HasColumnType("varchar(38)")
.HasColumnName("groupid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("RefType")
.HasColumnType("int")
.HasColumnName("ref_type");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<bool>("Removed")
.HasColumnType("tinyint(1)")
.HasColumnName("removed");
b.HasKey("Tenant", "UserId", "GroupId", "RefType")
.HasName("PRIMARY");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("UserId");
b.ToTable("core_usergroup");
});
modelBuilder.Entity("ASC.Core.Common.EF.UserSecurity", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(38)")
.HasColumnName("userid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime?>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("PwdHash")
.HasColumnType("varchar(512)")
.HasColumnName("pwdhash")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PwdHashSha512")
.HasColumnType("varchar(512)")
.HasColumnName("pwdhashsha512")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("UserId")
.HasName("PRIMARY");
b.HasIndex("PwdHash")
.HasDatabaseName("pwdhash");
b.HasIndex("Tenant")
.HasDatabaseName("tenant");
b.ToTable("core_usersecurity");
b.HasData(
new
{
UserId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
LastModified = new DateTime(2021, 10, 12, 14, 53, 22, 50, DateTimeKind.Utc).AddTicks(6123),
PwdHash = "vLFfghR5tNV3K9DKhmwArV+SbjWAcgZZzIDTnJ0JgCo=",
PwdHashSha512 = "USubvPlB+ogq0Q1trcSupg==",
Tenant = 1
});
});
modelBuilder.Entity("ASC.Core.Common.EF.UserGroup", b =>
{
b.HasOne("ASC.Core.Common.EF.User", null)
.WithMany("Groups")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("ASC.Core.Common.EF.UserSecurity", b =>
{
b.HasOne("ASC.Core.Common.EF.User", null)
.WithOne("UserSecurity")
.HasForeignKey("ASC.Core.Common.EF.UserSecurity", "UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("ASC.Core.Common.EF.User", b =>
{
b.Navigation("Groups");
b.Navigation("UserSecurity");
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.TenantDbContextPostgreSql
{
[DbContext(typeof(PostgreSqlTenantDbContext))]
partial class PostgreSqlTenantDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbCoreSettings", b =>
{
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.Property<string>("Id")
.HasColumnType("varchar(128)")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<byte[]>("Value")
.IsRequired()
.HasColumnType("mediumblob")
.HasColumnName("value");
b.HasKey("Tenant", "Id")
.HasName("PRIMARY");
b.ToTable("core_settings");
b.HasData(
new
{
Tenant = -1,
Id = "CompanyWhiteLabelSettings",
LastModified = new DateTime(2021, 10, 26, 12, 11, 31, 652, DateTimeKind.Utc).AddTicks(3019),
Value = new byte[] { 245, 71, 4, 138, 72, 101, 23, 21, 135, 217, 206, 188, 138, 73, 108, 96, 29, 150, 3, 31, 44, 28, 62, 145, 96, 53, 57, 66, 238, 118, 93, 172, 211, 22, 244, 181, 244, 40, 146, 67, 111, 196, 162, 27, 154, 109, 248, 255, 211, 188, 64, 54, 180, 126, 58, 90, 27, 76, 136, 27, 38, 96, 152, 105, 254, 187, 104, 72, 189, 136, 192, 46, 234, 198, 164, 204, 179, 232, 244, 4, 41, 8, 18, 240, 230, 225, 36, 165, 82, 190, 129, 165, 140, 100, 187, 139, 211, 201, 168, 192, 237, 225, 249, 66, 18, 129, 222, 12, 122, 248, 39, 51, 164, 188, 229, 21, 232, 86, 148, 196, 221, 167, 142, 34, 101, 43, 162, 137, 31, 206, 149, 120, 249, 114, 133, 168, 30, 18, 254, 223, 93, 101, 88, 97, 30, 58, 163, 224, 62, 173, 220, 170, 152, 40, 124, 100, 165, 81, 7, 87, 168, 129, 176, 12, 51, 69, 230, 252, 30, 34, 182, 7, 202, 45, 117, 60, 99, 241, 237, 148, 201, 35, 102, 219, 160, 228, 194, 230, 219, 22, 244, 74, 138, 176, 145, 0, 122, 167, 80, 93, 23, 228, 21, 48, 100, 60, 31, 250, 232, 34, 248, 249, 159, 210, 227, 12, 13, 239, 130, 223, 101, 196, 51, 36, 80, 127, 62, 92, 104, 228, 197, 226, 43, 232, 164, 12, 36, 66, 52, 133 }
},
new
{
Tenant = -1,
Id = "FullTextSearchSettings",
LastModified = new DateTime(2021, 10, 26, 12, 11, 31, 652, DateTimeKind.Utc).AddTicks(3037),
Value = new byte[] { 8, 120, 207, 5, 153, 181, 23, 202, 162, 211, 218, 237, 157, 6, 76, 62, 220, 238, 175, 67, 31, 53, 166, 246, 66, 220, 173, 160, 72, 23, 227, 81, 50, 39, 187, 177, 222, 110, 43, 171, 235, 158, 16, 119, 178, 207, 49, 140, 72, 152, 20, 84, 94, 135, 117, 1, 246, 51, 251, 190, 148, 2, 44, 252, 221, 2, 91, 83, 149, 151, 58, 245, 16, 148, 52, 8, 187, 86, 150, 46, 227, 93, 163, 95, 47, 131, 116, 207, 95, 209, 38, 149, 53, 148, 73, 215, 206, 251, 194, 199, 189, 17, 42, 229, 135, 82, 23, 154, 162, 165, 158, 94, 23, 128, 30, 88, 12, 204, 96, 250, 236, 142, 189, 211, 214, 18, 196, 136, 102, 102, 217, 109, 108, 240, 96, 96, 94, 100, 201, 10, 31, 170, 128, 192 }
},
new
{
Tenant = -1,
Id = "SmtpSettings",
LastModified = new DateTime(2021, 10, 26, 12, 11, 31, 652, DateTimeKind.Utc).AddTicks(3040),
Value = new byte[] { 240, 82, 224, 144, 161, 163, 117, 13, 173, 205, 78, 153, 97, 218, 4, 170, 81, 239, 1, 151, 226, 192, 98, 60, 241, 44, 88, 56, 191, 164, 10, 155, 72, 186, 239, 203, 227, 113, 88, 119, 49, 215, 227, 220, 158, 124, 96, 9, 116, 47, 158, 65, 93, 86, 219, 15, 10, 224, 142, 50, 248, 144, 75, 44, 68, 28, 198, 87, 198, 69, 67, 234, 238, 38, 32, 68, 162, 139, 67, 53, 220, 176, 240, 196, 233, 64, 29, 137, 31, 160, 99, 105, 249, 132, 202, 45, 71, 92, 134, 194, 55, 145, 121, 97, 197, 130, 119, 105, 131, 21, 133, 35, 10, 102, 172, 119, 135, 230, 251, 86, 253, 62, 55, 56, 146, 103, 164, 106 }
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Alias")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("alias")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Calls")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("calls")
.HasDefaultValueSql("true");
b.Property<DateTime>("CreationDateTime")
.HasColumnType("datetime")
.HasColumnName("creationdatetime");
b.Property<int?>("Industry")
.HasColumnType("int")
.HasColumnName("industry");
b.Property<string>("Language")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("char(10)")
.HasColumnName("language")
.HasDefaultValueSql("'en-US'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<string>("MappedDomain")
.HasColumnType("varchar(100)")
.HasColumnName("mappeddomain")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("owner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PaymentId")
.HasColumnType("varchar(38)")
.HasColumnName("payment_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Spam")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasColumnName("spam")
.HasDefaultValueSql("true");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<DateTime?>("StatusChanged")
.HasColumnType("datetime")
.HasColumnName("statuschanged");
b.Property<string>("TimeZone")
.HasColumnType("varchar(50)")
.HasColumnName("timezone")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("TrustedDomains")
.HasColumnType("varchar(1024)")
.HasColumnName("trusteddomains")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TrustedDomainsEnabled")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("trusteddomainsenabled")
.HasDefaultValueSql("'1'");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("version")
.HasDefaultValueSql("'2'");
b.Property<DateTime?>("Version_Changed")
.HasColumnType("datetime")
.HasColumnName("version_changed");
b.HasKey("Id");
b.HasIndex("LastModified")
.HasDatabaseName("last_modified");
b.HasIndex("MappedDomain")
.HasDatabaseName("mappeddomain");
b.HasIndex("Version")
.HasDatabaseName("version");
b.ToTable("tenants_tenants");
b.HasData(
new
{
Id = 1,
Alias = "localhost",
Calls = false,
CreationDateTime = new DateTime(2021, 3, 9, 17, 46, 59, 97, DateTimeKind.Utc).AddTicks(4317),
LastModified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Name = "Web Office",
OwnerId = "66faa6e4-f133-11ea-b126-00ffeec8b4ef",
Spam = false,
Status = 0,
TrustedDomainsEnabled = 0,
Version = 0
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantForbiden", b =>
{
b.Property<string>("Address")
.HasColumnType("varchar(50)")
.HasColumnName("address")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Address")
.HasName("PRIMARY");
b.ToTable("tenants_forbiden");
b.HasData(
new
{
Address = "controlpanel"
},
new
{
Address = "localhost"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantPartner", b =>
{
b.Property<int>("TenantId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("AffiliateId")
.HasColumnType("varchar(50)")
.HasColumnName("affiliate_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Campaign")
.HasColumnType("varchar(50)")
.HasColumnName("campaign")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("PartnerId")
.HasColumnType("varchar(36)")
.HasColumnName("partner_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId")
.HasName("PRIMARY");
b.ToTable("tenants_partners");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenantVersion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("DefaultVersion")
.HasColumnType("int")
.HasColumnName("default_version");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("version")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<bool>("Visible")
.HasColumnType("tinyint(1)")
.HasColumnName("visible");
b.HasKey("Id");
b.ToTable("tenants_version");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.TenantIpRestrictions", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("Ip")
.IsRequired()
.HasColumnType("varchar(50)")
.HasColumnName("ip")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Tenant")
.HasColumnType("int")
.HasColumnName("tenant");
b.HasKey("Id");
b.HasIndex("Tenant")
.HasDatabaseName("tenant");
b.ToTable("tenants_iprestrictions");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,127 +1,127 @@
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.WebstudioDbContextPostgreSql
{
[DbContext(typeof(PostgreSqlWebstudioDbContext))]
partial class PostgreSqlWebstudioDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioIndex", b =>
{
b.Property<string>("IndexName")
.HasColumnType("varchar(50)")
.HasColumnName("index_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.HasKey("IndexName")
.HasName("PRIMARY");
b.ToTable("webstudio_index");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioSettings", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("TenantID");
b.Property<string>("Id")
.HasColumnType("varchar(64)")
.HasColumnName("ID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("varchar(64)")
.HasColumnName("UserID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Data")
.IsRequired()
.HasColumnType("mediumtext")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId", "Id", "UserId")
.HasName("PRIMARY");
b.HasIndex("Id")
.HasDatabaseName("ID");
b.ToTable("webstudio_settings");
b.HasData(
new
{
TenantId = 1,
Id = "9a925891-1f92-4ed7-b277-d6f649739f06",
UserId = "00000000-0000-0000-0000-000000000000",
Data = "{'Completed':false}"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioUserVisit", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenantid");
b.Property<DateTime>("VisitDate")
.HasColumnType("datetime")
.HasColumnName("visitdate");
b.Property<string>("ProductId")
.HasColumnType("varchar(38)")
.HasColumnName("productid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("varchar(38)")
.HasColumnName("userid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("FirstVisitTime")
.HasColumnType("datetime")
.HasColumnName("firstvisittime");
b.Property<DateTime>("LastVisitTime")
.HasColumnType("datetime")
.HasColumnName("lastvisittime");
b.Property<int>("VisitCount")
.HasColumnType("int")
.HasColumnName("visitcount");
b.HasKey("TenantId", "VisitDate", "ProductId", "UserId")
.HasName("PRIMARY");
b.HasIndex("VisitDate")
.HasDatabaseName("visitdate");
b.ToTable("webstudio_uservisit");
});
#pragma warning restore 612, 618
}
}
}
// <auto-generated />
using System;
using ASC.Core.Common.EF.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Core.Common.Migrations.PostgreSql.WebstudioDbContextPostgreSql
{
[DbContext(typeof(PostgreSqlWebstudioDbContext))]
partial class PostgreSqlWebstudioDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioIndex", b =>
{
b.Property<string>("IndexName")
.HasColumnType("varchar(50)")
.HasColumnName("index_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("LastModified")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("last_modified")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.HasKey("IndexName")
.HasName("PRIMARY");
b.ToTable("webstudio_index");
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioSettings", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("TenantID");
b.Property<string>("Id")
.HasColumnType("varchar(64)")
.HasColumnName("ID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("varchar(64)")
.HasColumnName("UserID")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Data")
.IsRequired()
.HasColumnType("mediumtext")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId", "Id", "UserId")
.HasName("PRIMARY");
b.HasIndex("Id")
.HasDatabaseName("ID");
b.ToTable("webstudio_settings");
b.HasData(
new
{
TenantId = 1,
Id = "9a925891-1f92-4ed7-b277-d6f649739f06",
UserId = "00000000-0000-0000-0000-000000000000",
Data = "{\"Completed\":false}"
});
});
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbWebstudioUserVisit", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenantid");
b.Property<DateTime>("VisitDate")
.HasColumnType("datetime")
.HasColumnName("visitdate");
b.Property<string>("ProductId")
.HasColumnType("varchar(38)")
.HasColumnName("productid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.HasColumnType("varchar(38)")
.HasColumnName("userid")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("FirstVisitTime")
.HasColumnType("datetime")
.HasColumnName("firstvisittime");
b.Property<DateTime>("LastVisitTime")
.HasColumnType("datetime")
.HasColumnName("lastvisittime");
b.Property<int>("VisitCount")
.HasColumnType("int")
.HasColumnName("visitcount");
b.HasKey("TenantId", "VisitDate", "ProductId", "UserId")
.HasName("PRIMARY");
b.HasIndex("VisitDate")
.HasDatabaseName("visitdate");
b.ToTable("webstudio_uservisit");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,527 @@
// <auto-generated />
using System;
using ASC.Files.Core.EF;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ASC.Files.Core.Migrations.MySql.FilesDbContextMySql
{
[DbContext(typeof(MySqlFilesDbContext))]
[Migration("20211022170840_FilesDbContextMySql")]
partial class FilesDbContextMySql
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("ASC.Files.Core.EF.DbFile", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<int>("Id")
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Version")
.HasColumnType("int")
.HasColumnName("version");
b.Property<int>("Category")
.HasColumnType("int")
.HasColumnName("category");
b.Property<string>("Changes")
.HasColumnType("mediumtext")
.HasColumnName("changes")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Comment")
.HasColumnType("varchar(255)")
.HasColumnName("comment")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<long>("ContentLength")
.HasColumnType("bigint")
.HasColumnName("content_length");
b.Property<string>("ConvertedType")
.HasColumnType("varchar(10)")
.HasColumnName("converted_type")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("CreateBy")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("create_by")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreateOn")
.HasColumnType("datetime")
.HasColumnName("create_on");
b.Property<bool>("CurrentVersion")
.HasColumnType("tinyint(1)")
.HasColumnName("current_version");
b.Property<bool>("Encrypted")
.HasColumnType("tinyint(1)")
.HasColumnName("encrypted");
b.Property<int>("FileStatus")
.HasColumnType("int")
.HasColumnName("file_status");
b.Property<int>("FolderId")
.HasColumnType("int")
.HasColumnName("folder_id");
b.Property<int>("Forcesave")
.HasColumnType("int")
.HasColumnName("forcesave");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("modified_by")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("ModifiedOn")
.HasColumnType("datetime")
.HasColumnName("modified_on");
b.Property<int>("Thumb")
.HasColumnType("int")
.HasColumnName("thumb");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(400)")
.HasColumnName("title")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("VersionGroup")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("version_group")
.HasDefaultValueSql("'1'");
b.HasKey("TenantId", "Id", "Version")
.HasName("PRIMARY");
b.HasIndex("FolderId")
.HasDatabaseName("folder_id");
b.HasIndex("Id")
.HasDatabaseName("id");
b.HasIndex("ModifiedOn")
.HasDatabaseName("modified_on");
b.ToTable("files_file");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFilesBunchObjects", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("RightNode")
.HasColumnType("varchar(255)")
.HasColumnName("right_node")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("LeftNode")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("left_node")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("TenantId", "RightNode")
.HasName("PRIMARY");
b.HasIndex("LeftNode")
.HasDatabaseName("left_node");
b.ToTable("files_bunch_objects");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFilesSecurity", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("EntryId")
.HasColumnType("varchar(50)")
.HasColumnName("entry_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("EntryType")
.HasColumnType("int")
.HasColumnName("entry_type");
b.Property<string>("Subject")
.HasColumnType("char(38)")
.HasColumnName("subject")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Owner")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("owner")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("Security")
.HasColumnType("int")
.HasColumnName("security");
b.Property<DateTime>("TimeStamp")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("timestamp")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.HasKey("TenantId", "EntryId", "EntryType", "Subject")
.HasName("PRIMARY");
b.HasIndex("Owner")
.HasDatabaseName("owner");
b.HasIndex("TenantId", "EntryType", "EntryId", "Owner")
.HasDatabaseName("tenant_id");
b.ToTable("files_security");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFilesTag", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<int>("Flag")
.HasColumnType("int")
.HasColumnName("flag");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(255)")
.HasColumnName("name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Owner")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("owner")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.HasKey("Id");
b.HasIndex("TenantId", "Owner", "Name", "Flag")
.HasDatabaseName("name");
b.ToTable("files_tag");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFilesTagLink", b =>
{
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<int>("TagId")
.HasColumnType("int")
.HasColumnName("tag_id");
b.Property<string>("EntryId")
.HasColumnType("varchar(32)")
.HasColumnName("entry_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("EntryType")
.HasColumnType("int")
.HasColumnName("entry_type");
b.Property<string>("CreateBy")
.HasColumnType("char(38)")
.HasColumnName("create_by")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime?>("CreateOn")
.HasColumnType("datetime")
.HasColumnName("create_on");
b.Property<int>("TagCount")
.HasColumnType("int")
.HasColumnName("tag_count");
b.HasKey("TenantId", "TagId", "EntryId", "EntryType")
.HasName("PRIMARY");
b.HasIndex("CreateOn")
.HasDatabaseName("create_on");
b.HasIndex("TenantId", "EntryId", "EntryType")
.HasDatabaseName("entry_id");
b.ToTable("files_tag_link");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyAccount", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<DateTime>("CreateOn")
.HasColumnType("datetime")
.HasColumnName("create_on");
b.Property<int>("FolderType")
.HasColumnType("int")
.HasColumnName("folder_type");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("password")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Provider")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("varchar(50)")
.HasColumnName("provider")
.HasDefaultValueSql("'0'")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(400)")
.HasColumnName("customer_title")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Token")
.HasColumnType("text")
.HasColumnName("token")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Url")
.HasColumnType("text")
.HasColumnName("url")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("varchar(100)")
.HasColumnName("user_name")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.ToTable("files_thirdparty_account");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyApp", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(38)")
.HasColumnName("user_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("App")
.HasColumnType("varchar(50)")
.HasColumnName("app")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("ModifiedOn")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp")
.HasColumnName("modified_on")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("Token")
.HasColumnType("text")
.HasColumnName("token")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("UserId", "App")
.HasName("PRIMARY");
b.ToTable("files_thirdparty_app");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFilesThirdpartyIdMapping", b =>
{
b.Property<string>("HashId")
.HasColumnType("char(32)")
.HasColumnName("hash_id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<string>("Id")
.IsRequired()
.HasColumnType("text")
.HasColumnName("id")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.HasKey("HashId")
.HasName("PRIMARY");
b.HasIndex("TenantId", "HashId")
.HasDatabaseName("index_1");
b.ToTable("files_thirdparty_id_mapping");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFolder", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
b.Property<string>("CreateBy")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("create_by")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("CreateOn")
.HasColumnType("datetime")
.HasColumnName("create_on");
b.Property<int>("FilesCount")
.HasColumnType("int")
.HasColumnName("filesCount");
b.Property<int>("FolderType")
.HasColumnType("int")
.HasColumnName("folder_type");
b.Property<int>("FoldersCount")
.HasColumnType("int")
.HasColumnName("foldersCount");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("char(38)")
.HasColumnName("modified_by")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.Property<DateTime>("ModifiedOn")
.HasColumnType("datetime")
.HasColumnName("modified_on");
b.Property<int>("ParentId")
.HasColumnType("int")
.HasColumnName("parent_id");
b.Property<int>("TenantId")
.HasColumnType("int")
.HasColumnName("tenant_id");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(400)")
.HasColumnName("title")
.UseCollation("utf8_general_ci")
.HasAnnotation("MySql:CharSet", "utf8");
b.HasKey("Id");
b.HasIndex("ModifiedOn")
.HasDatabaseName("modified_on");
b.HasIndex("TenantId", "ParentId")
.HasDatabaseName("parent_id");
b.ToTable("files_folder");
});
modelBuilder.Entity("ASC.Files.Core.EF.DbFolderTree", b =>
{
b.Property<int>("ParentId")
.HasColumnType("int")
.HasColumnName("parent_id");
b.Property<int>("FolderId")
.HasColumnType("int")
.HasColumnName("folder_id");
b.Property<int>("Level")
.HasColumnType("int")
.HasColumnName("level");
b.HasKey("ParentId", "FolderId")
.HasName("PRIMARY");
b.HasIndex("FolderId")
.HasDatabaseName("folder_id");
b.ToTable("files_folder_tree");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,332 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ASC.Files.Core.Migrations.MySql.FilesDbContextMySql
{
public partial class FilesDbContextMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_bunch_objects",
columns: table => new
{
tenant_id = table.Column<int>(type: "int", nullable: false),
right_node = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
left_node = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenant_id, x.right_node });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_file",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false),
version = table.Column<int>(type: "int", nullable: false),
tenant_id = table.Column<int>(type: "int", nullable: false),
version_group = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'1'"),
current_version = table.Column<bool>(type: "tinyint(1)", nullable: false),
folder_id = table.Column<int>(type: "int", nullable: false),
title = table.Column<string>(type: "varchar(400)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
content_length = table.Column<long>(type: "bigint", nullable: false),
file_status = table.Column<int>(type: "int", nullable: false),
category = table.Column<int>(type: "int", nullable: false),
create_by = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
create_on = table.Column<DateTime>(type: "datetime", nullable: false),
modified_by = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
modified_on = table.Column<DateTime>(type: "datetime", nullable: false),
converted_type = table.Column<string>(type: "varchar(10)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
comment = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
changes = table.Column<string>(type: "mediumtext", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
encrypted = table.Column<bool>(type: "tinyint(1)", nullable: false),
forcesave = table.Column<int>(type: "int", nullable: false),
thumb = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenant_id, x.id, x.version });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_folder",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
parent_id = table.Column<int>(type: "int", nullable: false),
title = table.Column<string>(type: "varchar(400)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
folder_type = table.Column<int>(type: "int", nullable: false),
create_by = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
create_on = table.Column<DateTime>(type: "datetime", nullable: false),
modified_by = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
modified_on = table.Column<DateTime>(type: "datetime", nullable: false),
tenant_id = table.Column<int>(type: "int", nullable: false),
foldersCount = table.Column<int>(type: "int", nullable: false),
filesCount = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_files_folder", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_folder_tree",
columns: table => new
{
folder_id = table.Column<int>(type: "int", nullable: false),
parent_id = table.Column<int>(type: "int", nullable: false),
level = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.parent_id, x.folder_id });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_security",
columns: table => new
{
tenant_id = table.Column<int>(type: "int", nullable: false),
entry_id = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
entry_type = table.Column<int>(type: "int", nullable: false),
subject = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
owner = table.Column<string>(type: "char(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
security = table.Column<int>(type: "int", nullable: false),
timestamp = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenant_id, x.entry_id, x.entry_type, x.subject });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_tag",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
tenant_id = table.Column<int>(type: "int", nullable: false),
name = table.Column<string>(type: "varchar(255)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
owner = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
flag = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_files_tag", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_tag_link",
columns: table => new
{
tenant_id = table.Column<int>(type: "int", nullable: false),
tag_id = table.Column<int>(type: "int", nullable: false),
entry_type = table.Column<int>(type: "int", nullable: false),
entry_id = table.Column<string>(type: "varchar(32)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
create_by = table.Column<string>(type: "char(38)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
create_on = table.Column<DateTime>(type: "datetime", nullable: true),
tag_count = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.tenant_id, x.tag_id, x.entry_id, x.entry_type });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_thirdparty_account",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
provider = table.Column<string>(type: "varchar(50)", nullable: false, defaultValueSql: "'0'", collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
customer_title = table.Column<string>(type: "varchar(400)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
user_name = table.Column<string>(type: "varchar(100)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
password = table.Column<string>(type: "varchar(100)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
token = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
user_id = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
folder_type = table.Column<int>(type: "int", nullable: false),
create_on = table.Column<DateTime>(type: "datetime", nullable: false),
url = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
tenant_id = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_files_thirdparty_account", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_thirdparty_app",
columns: table => new
{
user_id = table.Column<string>(type: "varchar(38)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
app = table.Column<string>(type: "varchar(50)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
token = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
tenant_id = table.Column<int>(type: "int", nullable: false),
modified_on = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => new { x.user_id, x.app });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "files_thirdparty_id_mapping",
columns: table => new
{
hash_id = table.Column<string>(type: "char(32)", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
tenant_id = table.Column<int>(type: "int", nullable: false),
id = table.Column<string>(type: "text", nullable: false, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.hash_id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "left_node",
table: "files_bunch_objects",
column: "left_node");
migrationBuilder.CreateIndex(
name: "folder_id",
table: "files_file",
column: "folder_id");
migrationBuilder.CreateIndex(
name: "id",
table: "files_file",
column: "id");
migrationBuilder.CreateIndex(
name: "modified_on",
table: "files_file",
column: "modified_on");
migrationBuilder.CreateIndex(
name: "modified_on",
table: "files_folder",
column: "modified_on");
migrationBuilder.CreateIndex(
name: "parent_id",
table: "files_folder",
columns: new[] { "tenant_id", "parent_id" });
migrationBuilder.CreateIndex(
name: "folder_id",
table: "files_folder_tree",
column: "folder_id");
migrationBuilder.CreateIndex(
name: "owner",
table: "files_security",
column: "owner");
migrationBuilder.CreateIndex(
name: "tenant_id",
table: "files_security",
columns: new[] { "tenant_id", "entry_type", "entry_id", "owner" });
migrationBuilder.CreateIndex(
name: "name",
table: "files_tag",
columns: new[] { "tenant_id", "owner", "name", "flag" });
migrationBuilder.CreateIndex(
name: "create_on",
table: "files_tag_link",
column: "create_on");
migrationBuilder.CreateIndex(
name: "entry_id",
table: "files_tag_link",
columns: new[] { "tenant_id", "entry_id", "entry_type" });
migrationBuilder.CreateIndex(
name: "index_1",
table: "files_thirdparty_id_mapping",
columns: new[] { "tenant_id", "hash_id" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "files_bunch_objects");
migrationBuilder.DropTable(
name: "files_file");
migrationBuilder.DropTable(
name: "files_folder");
migrationBuilder.DropTable(
name: "files_folder_tree");
migrationBuilder.DropTable(
name: "files_security");
migrationBuilder.DropTable(
name: "files_tag");
migrationBuilder.DropTable(
name: "files_tag_link");
migrationBuilder.DropTable(
name: "files_thirdparty_account");
migrationBuilder.DropTable(
name: "files_thirdparty_app");
migrationBuilder.DropTable(
name: "files_thirdparty_id_mapping");
}
}
}