|
1 | | -using System; |
| 1 | +using System; |
2 | 2 | using Microsoft.EntityFrameworkCore.Migrations; |
3 | 3 |
|
4 | 4 | #nullable disable |
5 | 5 |
|
6 | | -namespace Qwertide.Api.Migrations |
| 6 | +namespace Qwertide.Api.Migrations; |
| 7 | + |
| 8 | +/// <inheritdoc /> |
| 9 | +public partial class InitialCreate : Migration |
7 | 10 | { |
8 | 11 | /// <inheritdoc /> |
9 | | - public partial class InitialCreate : Migration |
| 12 | + protected override void Up(MigrationBuilder migrationBuilder) |
10 | 13 | { |
11 | | - /// <inheritdoc /> |
12 | | - protected override void Up(MigrationBuilder migrationBuilder) |
13 | | - { |
14 | | - migrationBuilder.CreateTable( |
15 | | - name: "Scores", |
16 | | - columns: table => new |
17 | | - { |
18 | | - Id = table.Column<int>(type: "INTEGER", nullable: false) |
19 | | - .Annotation("Sqlite:Autoincrement", true), |
20 | | - PlayerName = table.Column<string>(type: "TEXT", maxLength: 30, nullable: false), |
21 | | - Wpm = table.Column<int>(type: "INTEGER", nullable: false), |
22 | | - Accuracy = table.Column<double>(type: "REAL", nullable: false), |
23 | | - DurationSecs = table.Column<double>(type: "REAL", nullable: false), |
24 | | - PassageId = table.Column<int>(type: "INTEGER", nullable: true), |
25 | | - CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false) |
26 | | - }, |
27 | | - constraints: table => |
28 | | - { |
29 | | - table.PrimaryKey("PK_Scores", x => x.Id); |
30 | | - }); |
| 14 | + migrationBuilder.CreateTable( |
| 15 | + name: "Scores", |
| 16 | + columns: table => new |
| 17 | + { |
| 18 | + Id = table.Column<int>(type: "INTEGER", nullable: false) |
| 19 | + .Annotation("Sqlite:Autoincrement", true), |
| 20 | + PlayerName = table.Column<string>(type: "TEXT", maxLength: 30, nullable: false), |
| 21 | + Wpm = table.Column<int>(type: "INTEGER", nullable: false), |
| 22 | + Accuracy = table.Column<double>(type: "REAL", nullable: false), |
| 23 | + DurationSecs = table.Column<double>(type: "REAL", nullable: false), |
| 24 | + PassageId = table.Column<int>(type: "INTEGER", nullable: true), |
| 25 | + CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false) |
| 26 | + }, |
| 27 | + constraints: table => |
| 28 | + { |
| 29 | + table.PrimaryKey("PK_Scores", x => x.Id); |
| 30 | + }); |
31 | 31 |
|
32 | | - migrationBuilder.CreateIndex( |
33 | | - name: "IX_Scores_Wpm", |
34 | | - table: "Scores", |
35 | | - column: "Wpm"); |
36 | | - } |
| 32 | + migrationBuilder.CreateIndex( |
| 33 | + name: "IX_Scores_Wpm", |
| 34 | + table: "Scores", |
| 35 | + column: "Wpm"); |
| 36 | + } |
37 | 37 |
|
38 | | - /// <inheritdoc /> |
39 | | - protected override void Down(MigrationBuilder migrationBuilder) |
40 | | - { |
41 | | - migrationBuilder.DropTable( |
42 | | - name: "Scores"); |
43 | | - } |
| 38 | + /// <inheritdoc /> |
| 39 | + protected override void Down(MigrationBuilder migrationBuilder) |
| 40 | + { |
| 41 | + migrationBuilder.DropTable( |
| 42 | + name: "Scores"); |
44 | 43 | } |
45 | 44 | } |
0 commit comments