summaryrefslogtreecommitdiff
path: root/Migrations/20221106035140_AddUser.cs
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-11-06 02:10:44 -0600
committerHombreLaser <sebastian-440@live.com>2022-11-06 02:10:44 -0600
commit08819c6738a4f82ccf07ae5ed60835b087f7bb34 (patch)
tree9c0c77626587136d41002769fb5a030e1be2f5b8 /Migrations/20221106035140_AddUser.cs
parentf060c4f88f635af3295ea7652cbbbd08dbf1c6cf (diff)
Añadidos grupos y usuarios
Diffstat (limited to 'Migrations/20221106035140_AddUser.cs')
-rw-r--r--Migrations/20221106035140_AddUser.cs146
1 files changed, 146 insertions, 0 deletions
diff --git a/Migrations/20221106035140_AddUser.cs b/Migrations/20221106035140_AddUser.cs
new file mode 100644
index 0000000..de69f56
--- /dev/null
+++ b/Migrations/20221106035140_AddUser.cs
@@ -0,0 +1,146 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace LibraryAPI.Migrations
+{
+ public partial class AddUser : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn<string>(
+ name: "Title",
+ table: "Books",
+ type: "character varying(128)",
+ maxLength: 128,
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<string>(
+ name: "ISBN",
+ table: "Books",
+ type: "text",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<string[]>(
+ name: "Genres",
+ table: "Books",
+ type: "text[]",
+ nullable: false,
+ defaultValue: new string[0],
+ oldClrType: typeof(string[]),
+ oldType: "text[]",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<string[]>(
+ name: "languages",
+ table: "Authors",
+ type: "text[]",
+ nullable: false,
+ defaultValue: new string[0],
+ oldClrType: typeof(string[]),
+ oldType: "text[]",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<string>(
+ name: "Name",
+ table: "Authors",
+ type: "character varying(64)",
+ maxLength: 64,
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn<string>(
+ name: "Country",
+ table: "Authors",
+ type: "text",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldNullable: true);
+
+ migrationBuilder.CreateTable(
+ name: "Users",
+ columns: table => new
+ {
+ Id = table.Column<long>(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Email = table.Column<string>(type: "text", nullable: false),
+ Password = table.Column<string>(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Users", x => x.Id);
+ });
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "Users");
+
+ migrationBuilder.AlterColumn<string>(
+ name: "Title",
+ table: "Books",
+ type: "text",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying(128)",
+ oldMaxLength: 128);
+
+ migrationBuilder.AlterColumn<string>(
+ name: "ISBN",
+ table: "Books",
+ type: "text",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "text");
+
+ migrationBuilder.AlterColumn<string[]>(
+ name: "Genres",
+ table: "Books",
+ type: "text[]",
+ nullable: true,
+ oldClrType: typeof(string[]),
+ oldType: "text[]");
+
+ migrationBuilder.AlterColumn<string[]>(
+ name: "languages",
+ table: "Authors",
+ type: "text[]",
+ nullable: true,
+ oldClrType: typeof(string[]),
+ oldType: "text[]");
+
+ migrationBuilder.AlterColumn<string>(
+ name: "Name",
+ table: "Authors",
+ type: "text",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying(64)",
+ oldMaxLength: 64);
+
+ migrationBuilder.AlterColumn<string>(
+ name: "Country",
+ table: "Authors",
+ type: "text",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "text");
+ }
+ }
+}