Files: quota* tables removed from filesDbContext
This commit is contained in:
parent
737359b21a
commit
aa0a31e2f6
@ -21,131 +21,6 @@ namespace ASC.Migrations.MySql.Migrations.FilesDb
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("ASC.Core.Common.EF.DbQuota", b =>
|
||||
{
|
||||
b.Property<int>("Tenant")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("tenant");
|
||||
|
||||
b.Property<int>("ActiveUsers")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("active_users")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
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");
|
||||
|
||||
b.Property<long>("MaxFileSize")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasColumnName("max_file_size")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.Property<long>("MaxTotalSize")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasColumnName("max_total_size")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("varchar(128)")
|
||||
.HasColumnName("name")
|
||||
.UseCollation("utf8_general_ci")
|
||||
.HasAnnotation("MySql:CharSet", "utf8");
|
||||
|
||||
b.Property<decimal>("Price")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("decimal(10,2)")
|
||||
.HasColumnName("price")
|
||||
.HasDefaultValueSql("'0.00'");
|
||||
|
||||
b.Property<bool>("Visible")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnName("visible")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.HasKey("Tenant")
|
||||
.HasName("PRIMARY");
|
||||
|
||||
b.ToTable("tenants_quota", (string)null);
|
||||
|
||||
b.HasAnnotation("MySql:CharSet", "utf8");
|
||||
|
||||
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.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")
|
||||
.HasColumnType("timestamp")
|
||||
.HasColumnName("create_on");
|
||||
|
||||
b.Property<int>("Quantity")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("quantity")
|
||||
.HasDefaultValueSql("'1'");
|
||||
|
||||
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", (string)null);
|
||||
|
||||
b.HasAnnotation("MySql:CharSet", "utf8");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
@ -1,4 +1,29 @@
|
||||
using System;
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
@ -283,51 +308,6 @@ namespace ASC.Migrations.MySql.Migrations.FilesDb
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "tenants_quota",
|
||||
columns: table => new
|
||||
{
|
||||
tenant = table.Column<int>(type: "int", nullable: false),
|
||||
name = table.Column<string>(type: "varchar(128)", nullable: true, collation: "utf8_general_ci")
|
||||
.Annotation("MySql:CharSet", "utf8"),
|
||||
description = table.Column<string>(type: "varchar(128)", nullable: true, collation: "utf8_general_ci")
|
||||
.Annotation("MySql:CharSet", "utf8"),
|
||||
max_file_size = table.Column<long>(type: "bigint", nullable: false, defaultValueSql: "'0'"),
|
||||
max_total_size = table.Column<long>(type: "bigint", nullable: false, defaultValueSql: "'0'"),
|
||||
active_users = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'0'"),
|
||||
features = table.Column<string>(type: "text", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8"),
|
||||
price = table.Column<decimal>(type: "decimal(10,2)", nullable: false, defaultValueSql: "'0.00'"),
|
||||
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, defaultValueSql: "'0'")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PRIMARY", x => x.tenant);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "tenants_tariff",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
tenant = table.Column<int>(type: "int", nullable: false),
|
||||
tariff = table.Column<int>(type: "int", nullable: false),
|
||||
stamp = table.Column<DateTime>(type: "datetime", nullable: false),
|
||||
quantity = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'1'"),
|
||||
comment = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
|
||||
.Annotation("MySql:CharSet", "utf8"),
|
||||
create_on = table.Column<DateTime>(type: "timestamp", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_tenants_tariff", x => x.id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "tenants_tenants",
|
||||
columns: table => new
|
||||
@ -722,11 +702,6 @@ namespace ASC.Migrations.MySql.Migrations.FilesDb
|
||||
{ ".xps", ".pdf" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "tenants_quota",
|
||||
columns: new[] { "tenant", "active_users", "avangate_id", "description", "features", "max_file_size", "max_total_size", "name" },
|
||||
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" });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "tenants_tenants",
|
||||
columns: new[] { "id", "alias", "creationdatetime", "last_modified", "mappeddomain", "name", "owner_id", "payment_id", "statuschanged", "timezone", "trusteddomains", "version_changed" },
|
||||
@ -807,11 +782,6 @@ namespace ASC.Migrations.MySql.Migrations.FilesDb
|
||||
table: "files_thirdparty_id_mapping",
|
||||
columns: new[] { "tenant_id", "hash_id" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "tenant",
|
||||
table: "tenants_tariff",
|
||||
column: "tenant");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "alias",
|
||||
table: "tenants_tenants",
|
||||
@ -875,12 +845,6 @@ namespace ASC.Migrations.MySql.Migrations.FilesDb
|
||||
migrationBuilder.DropTable(
|
||||
name: "files_thirdparty_id_mapping");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "tenants_quota");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "tenants_tariff");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "tenants_tenants");
|
||||
}
|
||||
|
@ -19,131 +19,6 @@ namespace ASC.Migrations.MySql.Migrations.FilesDb
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("ASC.Core.Common.EF.DbQuota", b =>
|
||||
{
|
||||
b.Property<int>("Tenant")
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("tenant");
|
||||
|
||||
b.Property<int>("ActiveUsers")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("active_users")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
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");
|
||||
|
||||
b.Property<long>("MaxFileSize")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasColumnName("max_file_size")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.Property<long>("MaxTotalSize")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasColumnName("max_total_size")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("varchar(128)")
|
||||
.HasColumnName("name")
|
||||
.UseCollation("utf8_general_ci")
|
||||
.HasAnnotation("MySql:CharSet", "utf8");
|
||||
|
||||
b.Property<decimal>("Price")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("decimal(10,2)")
|
||||
.HasColumnName("price")
|
||||
.HasDefaultValueSql("'0.00'");
|
||||
|
||||
b.Property<bool>("Visible")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnName("visible")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.HasKey("Tenant")
|
||||
.HasName("PRIMARY");
|
||||
|
||||
b.ToTable("tenants_quota", (string)null);
|
||||
|
||||
b.HasAnnotation("MySql:CharSet", "utf8");
|
||||
|
||||
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.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")
|
||||
.HasColumnType("timestamp")
|
||||
.HasColumnName("create_on");
|
||||
|
||||
b.Property<int>("Quantity")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasColumnName("quantity")
|
||||
.HasDefaultValueSql("'1'");
|
||||
|
||||
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", (string)null);
|
||||
|
||||
b.HasAnnotation("MySql:CharSet", "utf8");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
@ -23,122 +23,6 @@ namespace ASC.Migrations.PostgreSql.Migrations
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("ASC.Core.Common.EF.DbQuota", b =>
|
||||
{
|
||||
b.Property<int>("Tenant")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("tenant");
|
||||
|
||||
b.Property<int>("ActiveUsers")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("active_users");
|
||||
|
||||
b.Property<string>("AvangateId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)")
|
||||
.HasColumnName("avangate_id")
|
||||
.HasDefaultValueSql("NULL");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<string>("Features")
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("features");
|
||||
|
||||
b.Property<long>("MaxFileSize")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasColumnName("max_file_size")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.Property<long>("MaxTotalSize")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasColumnName("max_total_size")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("character varying")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<decimal>("Price")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("numeric(10,2)")
|
||||
.HasColumnName("price")
|
||||
.HasDefaultValueSql("0.00");
|
||||
|
||||
b.Property<bool>("Visible")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("visible");
|
||||
|
||||
b.HasKey("Tenant")
|
||||
.HasName("tenants_quota_pkey");
|
||||
|
||||
b.ToTable("tenants_quota", "onlyoffice");
|
||||
|
||||
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.DbTariff", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("character varying(255)")
|
||||
.HasColumnName("comment")
|
||||
.HasDefaultValueSql("NULL");
|
||||
|
||||
b.Property<DateTime>("CreateOn")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("create_on")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
|
||||
b.Property<int>("Quantity")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("quantity");
|
||||
|
||||
b.Property<DateTime>("Stamp")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("stamp");
|
||||
|
||||
b.Property<int>("Tariff")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("tariff");
|
||||
|
||||
b.Property<int>("Tenant")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("tenant");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Tenant")
|
||||
.HasDatabaseName("tenant_tenants_tariff");
|
||||
|
||||
b.ToTable("tenants_tariff", "onlyoffice");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
@ -1,5 +1,31 @@
|
||||
using System;
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
@ -245,46 +271,6 @@ namespace ASC.Migrations.PostgreSql.Migrations
|
||||
table.PrimaryKey("files_thirdparty_id_mapping_pkey", x => x.hash_id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "tenants_quota",
|
||||
schema: "onlyoffice",
|
||||
columns: table => new
|
||||
{
|
||||
tenant = table.Column<int>(type: "integer", nullable: false),
|
||||
name = table.Column<string>(type: "character varying", nullable: true),
|
||||
description = table.Column<string>(type: "character varying", nullable: true),
|
||||
max_file_size = table.Column<long>(type: "bigint", nullable: false, defaultValueSql: "'0'"),
|
||||
max_total_size = table.Column<long>(type: "bigint", nullable: false, defaultValueSql: "'0'"),
|
||||
active_users = table.Column<int>(type: "integer", nullable: false),
|
||||
features = table.Column<string>(type: "text", nullable: true),
|
||||
price = table.Column<decimal>(type: "numeric(10,2)", nullable: false, defaultValueSql: "0.00"),
|
||||
avangate_id = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, defaultValueSql: "NULL"),
|
||||
visible = table.Column<bool>(type: "boolean", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("tenants_quota_pkey", x => x.tenant);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "tenants_tariff",
|
||||
schema: "onlyoffice",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
tenant = table.Column<int>(type: "integer", nullable: false),
|
||||
tariff = table.Column<int>(type: "integer", nullable: false),
|
||||
stamp = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
quantity = table.Column<int>(type: "integer", nullable: false),
|
||||
comment = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true, defaultValueSql: "NULL"),
|
||||
create_on = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_tenants_tariff", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "tenants_tenants",
|
||||
schema: "onlyoffice",
|
||||
@ -672,12 +658,6 @@ namespace ASC.Migrations.PostgreSql.Migrations
|
||||
{ ".xps", ".pdf" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
schema: "onlyoffice",
|
||||
table: "tenants_quota",
|
||||
columns: new[] { "tenant", "active_users", "avangate_id", "description", "features", "max_file_size", "max_total_size", "name", "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", false });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
schema: "onlyoffice",
|
||||
table: "tenants_tenants",
|
||||
@ -774,12 +754,6 @@ namespace ASC.Migrations.PostgreSql.Migrations
|
||||
table: "files_thirdparty_id_mapping",
|
||||
columns: new[] { "tenant_id", "hash_id" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "tenant_tenants_tariff",
|
||||
schema: "onlyoffice",
|
||||
table: "tenants_tariff",
|
||||
column: "tenant");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "alias",
|
||||
schema: "onlyoffice",
|
||||
@ -860,14 +834,6 @@ namespace ASC.Migrations.PostgreSql.Migrations
|
||||
name: "files_thirdparty_id_mapping",
|
||||
schema: "onlyoffice");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "tenants_quota",
|
||||
schema: "onlyoffice");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "tenants_tariff",
|
||||
schema: "onlyoffice");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "tenants_tenants",
|
||||
schema: "onlyoffice");
|
||||
|
@ -21,122 +21,6 @@ namespace ASC.Migrations.PostgreSql.Migrations
|
||||
.HasAnnotation("ProductVersion", "6.0.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("ASC.Core.Common.EF.DbQuota", b =>
|
||||
{
|
||||
b.Property<int>("Tenant")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("tenant");
|
||||
|
||||
b.Property<int>("ActiveUsers")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("active_users");
|
||||
|
||||
b.Property<string>("AvangateId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)")
|
||||
.HasColumnName("avangate_id")
|
||||
.HasDefaultValueSql("NULL");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<string>("Features")
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("features");
|
||||
|
||||
b.Property<long>("MaxFileSize")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasColumnName("max_file_size")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.Property<long>("MaxTotalSize")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasColumnName("max_total_size")
|
||||
.HasDefaultValueSql("'0'");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("character varying")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<decimal>("Price")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("numeric(10,2)")
|
||||
.HasColumnName("price")
|
||||
.HasDefaultValueSql("0.00");
|
||||
|
||||
b.Property<bool>("Visible")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("visible");
|
||||
|
||||
b.HasKey("Tenant")
|
||||
.HasName("tenants_quota_pkey");
|
||||
|
||||
b.ToTable("tenants_quota", "onlyoffice");
|
||||
|
||||
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.DbTariff", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Comment")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("character varying(255)")
|
||||
.HasColumnName("comment")
|
||||
.HasDefaultValueSql("NULL");
|
||||
|
||||
b.Property<DateTime>("CreateOn")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("create_on")
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
|
||||
b.Property<int>("Quantity")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("quantity");
|
||||
|
||||
b.Property<DateTime>("Stamp")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("stamp");
|
||||
|
||||
b.Property<int>("Tariff")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("tariff");
|
||||
|
||||
b.Property<int>("Tenant")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("tenant");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Tenant")
|
||||
.HasDatabaseName("tenant_tenants_tariff");
|
||||
|
||||
b.ToTable("tenants_tariff", "onlyoffice");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ASC.Core.Common.EF.Model.DbTenant", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
@ -40,8 +40,6 @@ public class FilesDbContext : DbContext
|
||||
public DbSet<DbFilesThirdpartyApp> ThirdpartyApp { get; set; }
|
||||
public DbSet<DbFilesLink> FilesLink { get; set; }
|
||||
public DbSet<DbFilesProperties> FilesProperties { get; set; }
|
||||
public DbSet<DbTariff> Tariffs { get; set; }
|
||||
public DbSet<DbQuota> Quotas { get; set; }
|
||||
public DbSet<DbTenant> Tenants { get; set; }
|
||||
public DbSet<FilesConverts> FilesConverts { get; set; }
|
||||
|
||||
@ -63,9 +61,6 @@ public class FilesDbContext : DbContext
|
||||
.AddDbDbFilesThirdpartyApp()
|
||||
.AddDbFilesLink()
|
||||
.AddDbFilesProperties()
|
||||
.AddDbTariff()
|
||||
.AddDbTariffRow()
|
||||
.AddDbQuota()
|
||||
.AddDbTenant()
|
||||
.AddFilesConverts();
|
||||
}
|
||||
|
@ -34,16 +34,20 @@ internal class FileDataProvider
|
||||
private readonly ThumbnailSettings _thumbnailSettings;
|
||||
private readonly ICache _cache;
|
||||
private readonly IDbContextFactory<FilesDbContext> _dbContextFactory;
|
||||
private readonly IDbContextFactory<CoreDbContext> _coreContextFactory;
|
||||
private readonly string _cacheKey;
|
||||
|
||||
public FileDataProvider(
|
||||
ThumbnailSettings settings,
|
||||
ICache ascCache,
|
||||
IDbContextFactory<FilesDbContext> dbContextFactory)
|
||||
IDbContextFactory<FilesDbContext> dbContextFactory,
|
||||
IDbContextFactory<CoreDbContext> coreContextFactory
|
||||
)
|
||||
{
|
||||
_thumbnailSettings = settings;
|
||||
_cache = ascCache;
|
||||
_dbContextFactory = dbContextFactory;
|
||||
_coreContextFactory = coreContextFactory;
|
||||
_cacheKey = "PremiumTenants";
|
||||
}
|
||||
|
||||
@ -83,7 +87,7 @@ internal class FileDataProvider
|
||||
group by t.tenant
|
||||
*/
|
||||
|
||||
using var filesDbContext = _dbContextFactory.CreateDbContext();
|
||||
using var filesDbContext = _coreContextFactory.CreateDbContext();
|
||||
var search =
|
||||
filesDbContext.Tariffs
|
||||
.Join(filesDbContext.Quotas.AsQueryable().DefaultIfEmpty(), a => a.Tariff, b => b.Tenant, (tariff, quota) => new { tariff, quota })
|
||||
|
Loading…
Reference in New Issue
Block a user