-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup sqlite database with migrations
- Loading branch information
a.civier
committed
May 17, 2024
1 parent
b105b74
commit a9261bc
Showing
8 changed files
with
157 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ | |
*.userosscache | ||
*.sln.docstates | ||
|
||
# SQl Lite Database | ||
app.db* | ||
|
||
# Vite files | ||
.vite | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/Infrastructure/Data/Migrations/20240517132224_InitialCreate.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
src/Infrastructure/Data/Migrations/20240517132224_InitialCreate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#nullable disable | ||
|
||
namespace WebAppStarter.Infrastructure.Data.Migrations | ||
{ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
/// <inheritdoc /> | ||
public partial class InitialCreate : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "TodoItems", | ||
columns: table => new | ||
{ | ||
Id = table.Column<int>(type: "INTEGER", nullable: false) | ||
.Annotation("Sqlite:Autoincrement", true), | ||
Owner = table.Column<Guid>(type: "TEXT", nullable: false), | ||
Description = table.Column<string>(type: "TEXT", nullable: false), | ||
Created = table.Column<DateTimeOffset>(type: "TEXT", nullable: false), | ||
CreatedBy = table.Column<Guid>(type: "TEXT", nullable: true), | ||
LastModified = table.Column<DateTimeOffset>(type: "TEXT", nullable: false), | ||
LastModifiedBy = table.Column<Guid>(type: "TEXT", nullable: true), | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_TodoItems", x => x.Id); | ||
}); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "TodoItems"); | ||
} | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/Infrastructure/Data/Migrations/ApplicationDbContextModelSnapshot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// <auto-generated /> | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||
using WebAppStarter.Infrastructure.Data; | ||
|
||
#nullable disable | ||
|
||
namespace WebAppStarter.Infrastructure.Data.Migrations | ||
{ | ||
[DbContext(typeof(ApplicationDbContext))] | ||
partial class ApplicationDbContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
#pragma warning disable 612, 618 | ||
modelBuilder.HasAnnotation("ProductVersion", "8.0.5"); | ||
|
||
modelBuilder.Entity("WebAppStarter.Domain.Entities.TodoItem", b => | ||
{ | ||
b.Property<int>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasColumnType("INTEGER"); | ||
|
||
b.Property<DateTimeOffset>("Created") | ||
.HasColumnType("TEXT"); | ||
|
||
b.Property<Guid?>("CreatedBy") | ||
.HasColumnType("TEXT"); | ||
|
||
b.Property<string>("Description") | ||
.IsRequired() | ||
.HasColumnType("TEXT"); | ||
|
||
b.Property<DateTimeOffset>("LastModified") | ||
.HasColumnType("TEXT"); | ||
|
||
b.Property<Guid?>("LastModifiedBy") | ||
.HasColumnType("TEXT"); | ||
|
||
b.Property<Guid>("Owner") | ||
.HasColumnType("TEXT"); | ||
|
||
b.HasKey("Id"); | ||
|
||
b.ToTable("TodoItems"); | ||
}); | ||
#pragma warning restore 612, 618 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters