提交 f8b658ba 编写于 作者: 麦壳饼's avatar 麦壳饼

调整mysql和pgsql sqlite相关的数据库结构体。

上级 c698ed45
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTSharp.Data.MySql.Migrations
{
public partial class AddTenantInfoAndToken : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_BaseEvents_Customer_CustomerId",
table: "BaseEvents");
migrationBuilder.DropForeignKey(
name: "FK_BaseEvents_Tenant_TenantId",
table: "BaseEvents");
migrationBuilder.AlterColumn<Guid>(
name: "TenantId",
table: "BaseEvents",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "CustomerId",
table: "BaseEvents",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_BaseEvents_Customer_CustomerId",
table: "BaseEvents",
column: "CustomerId",
principalTable: "Customer",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_BaseEvents_Tenant_TenantId",
table: "BaseEvents",
column: "TenantId",
principalTable: "Tenant",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_BaseEvents_Customer_CustomerId",
table: "BaseEvents");
migrationBuilder.DropForeignKey(
name: "FK_BaseEvents_Tenant_TenantId",
table: "BaseEvents");
migrationBuilder.AlterColumn<Guid>(
name: "TenantId",
table: "BaseEvents",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "CustomerId",
table: "BaseEvents",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_BaseEvents_Customer_CustomerId",
table: "BaseEvents",
column: "CustomerId",
principalTable: "Customer",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_BaseEvents_Tenant_TenantId",
table: "BaseEvents",
column: "TenantId",
principalTable: "Tenant",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}
......@@ -8,8 +8,8 @@
},
"DataBase": "MySql",
"ConnectionStrings": {
"IoTSharp": "server=localhost;user=root;password=kissme;database=IoTSharp",
"TelemetryStorage": "server=localhost;user=root;password=kissme;database=IoTSharp"
"IoTSharp": "server=localhost;user=root;password=kissme;database=IoTSharp1",
"TelemetryStorage": "server=localhost;user=root;password=kissme;database=IoTSharp1"
},
"JwtKey": "kissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissme",
"JwtExpireHours": 3,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册