mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
@@ -14,8 +14,7 @@ namespace SharpbinV3.Server.Migrations
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
UID = table
|
||||
.Column<int>(type: "INTEGER", nullable: false)
|
||||
UID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
UUID = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Username = table.Column<string>(type: "TEXT", nullable: false),
|
||||
@@ -24,20 +23,18 @@ namespace SharpbinV3.Server.Migrations
|
||||
DisplayName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LastLogin = table.Column<long>(type: "INTEGER", nullable: true),
|
||||
Roles = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Visiblity = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Visiblity = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.UID);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Pastes",
|
||||
columns: table => new
|
||||
{
|
||||
PID = table
|
||||
.Column<int>(type: "INTEGER", nullable: false)
|
||||
PID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
UUID = table.Column<string>(type: "TEXT", nullable: false),
|
||||
ID = table.Column<string>(type: "TEXT", nullable: true),
|
||||
@@ -51,7 +48,7 @@ namespace SharpbinV3.Server.Migrations
|
||||
Views = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Syntax = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Visiblity = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
ExpiresAt = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
ExpiresAt = table.Column<long>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -60,10 +57,8 @@ namespace SharpbinV3.Server.Migrations
|
||||
name: "FK_Pastes_Users_UserUID",
|
||||
column: x => x.UserUID,
|
||||
principalTable: "Users",
|
||||
principalColumn: "UID"
|
||||
);
|
||||
}
|
||||
);
|
||||
principalColumn: "UID");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RefreshTokens",
|
||||
@@ -75,7 +70,7 @@ namespace SharpbinV3.Server.Migrations
|
||||
CreatedAt = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
ExpiresAt = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
Used = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
UserUID = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
UserUID = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -84,87 +79,81 @@ namespace SharpbinV3.Server.Migrations
|
||||
name: "FK_RefreshTokens_Users_UserUID",
|
||||
column: x => x.UserUID,
|
||||
principalTable: "Users",
|
||||
principalColumn: "UID"
|
||||
);
|
||||
}
|
||||
);
|
||||
principalColumn: "UID");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Pastes_AuthorUUID",
|
||||
table: "Pastes",
|
||||
column: "AuthorUUID"
|
||||
);
|
||||
column: "AuthorUUID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Pastes_ExpiresAt",
|
||||
table: "Pastes",
|
||||
column: "ExpiresAt"
|
||||
);
|
||||
column: "ExpiresAt");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Pastes_ID",
|
||||
table: "Pastes",
|
||||
column: "ID",
|
||||
unique: true
|
||||
);
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Pastes_PID",
|
||||
table: "Pastes",
|
||||
column: "PID",
|
||||
unique: true
|
||||
);
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Pastes_UserUID",
|
||||
table: "Pastes",
|
||||
column: "UserUID"
|
||||
);
|
||||
column: "UserUID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Pastes_UUID",
|
||||
table: "Pastes",
|
||||
column: "UUID",
|
||||
unique: true
|
||||
);
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(name: "IX_Pastes_Views", table: "Pastes", column: "Views");
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Pastes_Views",
|
||||
table: "Pastes",
|
||||
column: "Views");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Pastes_Visiblity",
|
||||
table: "Pastes",
|
||||
column: "Visiblity"
|
||||
);
|
||||
column: "Visiblity");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RefreshTokens_UserUID",
|
||||
table: "RefreshTokens",
|
||||
column: "UserUID"
|
||||
);
|
||||
column: "UserUID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_UID",
|
||||
table: "Users",
|
||||
column: "UID",
|
||||
unique: true
|
||||
);
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_UUID",
|
||||
table: "Users",
|
||||
column: "UUID",
|
||||
unique: true
|
||||
);
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(name: "Pastes");
|
||||
migrationBuilder.DropTable(
|
||||
name: "Pastes");
|
||||
|
||||
migrationBuilder.DropTable(name: "RefreshTokens");
|
||||
migrationBuilder.DropTable(
|
||||
name: "RefreshTokens");
|
||||
|
||||
migrationBuilder.DropTable(name: "Users");
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user