Skip to content

Commit

Permalink
migrations added
Browse files Browse the repository at this point in the history
  • Loading branch information
chsami committed May 18, 2024
1 parent 2bdb51b commit 3f4e017
Show file tree
Hide file tree
Showing 11 changed files with 770 additions and 0 deletions.
51 changes: 51 additions & 0 deletions MicrobotApi/Database/Migrations/20240309205050_init.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions MicrobotApi/Database/Migrations/20240309205050_init.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MicrobotApi.Database.Migrations
{
/// <inheritdoc />
public partial class init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Sessions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
IsLoggedIn = table.Column<bool>(type: "boolean", nullable: false),
Version = table.Column<string>(type: "text", nullable: false),
LastPing = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Sessions", x => x.Id);
});
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Sessions");
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions MicrobotApi/Database/Migrations/20240309210806_lastpinged.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MicrobotApi.Database.Migrations
{
/// <inheritdoc />
public partial class lastpinged : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{

}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{

}
}
}
96 changes: 96 additions & 0 deletions MicrobotApi/Database/Migrations/20240505202109_user.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions MicrobotApi/Database/Migrations/20240505202109_user.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MicrobotApi.Database.Migrations
{
/// <inheritdoc />
public partial class user : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Token = table.Column<string>(type: "text", nullable: false),
RefreshToken = table.Column<string>(type: "text", nullable: false),
TokenExpiry = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Discriminator = table.Column<string>(type: "character varying(13)", maxLength: 13, nullable: false),
DiscordId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});

migrationBuilder.CreateIndex(
name: "IX_Users_DiscordId",
table: "Users",
column: "DiscordId");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Users");
}
}
}
Loading

0 comments on commit 3f4e017

Please sign in to comment.