Refactor schema and test data; remove DAL code

Removed all DataAccessLayer C# code and related test project files. Updated schema.sql to add Country, StateProvince, and City tables, refactored brewery and beer post tables to include location and concurrency columns, and replaced the old comment/rating system with BeerPostComment. Updated test-data.sql to seed new location tables and refactored brewery data to use city and coordinates.
This commit is contained in:
Aaron Po
2025-11-11 03:45:01 -05:00
parent 8975044034
commit 33db1368ec
19 changed files with 246 additions and 828 deletions

13
.config/dotnet-tools.json Normal file
View File

@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.1.2",
"commands": [
"csharpier"
],
"rollForward": false
}
}
}

View File

@@ -1,23 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
</Project>

View File

@@ -1,35 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class BeerPost
{
public Guid BeerPostID { get; set; }
public string Name { get; set; } = null!;
public string Description { get; set; } = null!;
public decimal ABV { get; set; }
public int IBU { get; set; }
public Guid PostedByID { get; set; }
public Guid BeerStyleID { get; set; }
public Guid BrewedByID { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public virtual ICollection<BeerPostPhoto> BeerPostPhotos { get; set; } = new List<BeerPostPhoto>();
public virtual BeerStyle BeerStyle { get; set; } = null!;
public virtual BreweryPost BrewedBy { get; set; } = null!;
public virtual UserAccount PostedBy { get; set; } = null!;
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class BeerPostPhoto
{
public Guid BeerPostPhotoID { get; set; }
public Guid BeerPostID { get; set; }
public Guid PhotoID { get; set; }
public DateTime LinkedAt { get; set; }
public virtual BeerPost BeerPost { get; set; } = null!;
public virtual Photo Photo { get; set; } = null!;
}

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class BeerStyle
{
public Guid BeerStyleID { get; set; }
public string StyleName { get; set; } = null!;
public string? Description { get; set; }
public virtual ICollection<BeerPost> BeerPosts { get; set; } = new List<BeerPost>();
}

View File

@@ -1,300 +0,0 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace DataAccessLayer;
public partial class BiergartenContext : DbContext
{
public BiergartenContext()
{
}
public BiergartenContext(DbContextOptions<BiergartenContext> options)
: base(options)
{
}
public virtual DbSet<BeerPost> BeerPosts { get; set; }
public virtual DbSet<BeerPostPhoto> BeerPostPhotos { get; set; }
public virtual DbSet<BeerStyle> BeerStyles { get; set; }
public virtual DbSet<BreweryPost> BreweryPosts { get; set; }
public virtual DbSet<BreweryPostPhoto> BreweryPostPhotos { get; set; }
public virtual DbSet<Comment> Comments { get; set; }
public virtual DbSet<Photo> Photos { get; set; }
public virtual DbSet<UserAccount> UserAccounts { get; set; }
public virtual DbSet<UserAvatar> UserAvatars { get; set; }
public virtual DbSet<UserCredential> UserCredentials { get; set; }
public virtual DbSet<UserFollow> UserFollows { get; set; }
public virtual DbSet<UserVerification> UserVerifications { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
=> optionsBuilder.UseSqlServer("Server=(localdb)\\ProjectModels;Database=Biergarten;Trusted_Connection=True;");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<BeerPost>(entity =>
{
entity.ToTable("BeerPost");
entity.HasIndex(e => e.BeerStyleID, "IX_BeerPost_BeerStyle");
entity.HasIndex(e => e.BrewedByID, "IX_BeerPost_BrewedBy");
entity.HasIndex(e => e.PostedByID, "IX_BeerPost_PostedBy");
entity.Property(e => e.BeerPostID).HasDefaultValueSql("(newid())");
entity.Property(e => e.ABV).HasColumnType("decimal(4, 2)");
entity.Property(e => e.CreatedAt)
.HasDefaultValueSql("(getdate())")
.HasColumnType("datetime");
entity.Property(e => e.Name).HasMaxLength(100);
entity.Property(e => e.UpdatedAt).HasColumnType("datetime");
entity.HasOne(d => d.BeerStyle).WithMany(p => p.BeerPosts)
.HasForeignKey(d => d.BeerStyleID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_BeerPost_BeerStyle");
entity.HasOne(d => d.BrewedBy).WithMany(p => p.BeerPosts)
.HasForeignKey(d => d.BrewedByID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_BeerPost_Brewery");
entity.HasOne(d => d.PostedBy).WithMany(p => p.BeerPosts)
.HasForeignKey(d => d.PostedByID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_BeerPost_PostedBy");
});
modelBuilder.Entity<BeerPostPhoto>(entity =>
{
entity.ToTable("BeerPostPhoto");
entity.HasIndex(e => new { e.BeerPostID, e.PhotoID }, "IX_BeerPostPhoto_BeerPost_Photo");
entity.HasIndex(e => new { e.PhotoID, e.BeerPostID }, "IX_BeerPostPhoto_Photo_BeerPost");
entity.Property(e => e.BeerPostPhotoID).HasDefaultValueSql("(newid())");
entity.Property(e => e.LinkedAt)
.HasDefaultValueSql("(getdate())")
.HasColumnType("datetime");
entity.HasOne(d => d.BeerPost).WithMany(p => p.BeerPostPhotos)
.HasForeignKey(d => d.BeerPostID)
.HasConstraintName("FK_BeerPostPhoto_BeerPost");
entity.HasOne(d => d.Photo).WithMany(p => p.BeerPostPhotos)
.HasForeignKey(d => d.PhotoID)
.HasConstraintName("FK_BeerPostPhoto_Photo");
});
modelBuilder.Entity<BeerStyle>(entity =>
{
entity.ToTable("BeerStyle");
entity.HasIndex(e => e.StyleName, "AK_BeerStyle_StyleName").IsUnique();
entity.Property(e => e.BeerStyleID).HasDefaultValueSql("(newid())");
entity.Property(e => e.StyleName).HasMaxLength(100);
});
modelBuilder.Entity<BreweryPost>(entity =>
{
entity.ToTable("BreweryPost");
entity.HasIndex(e => e.PostedByID, "IX_BreweryPost_PostedByID");
entity.Property(e => e.BreweryPostID).HasDefaultValueSql("(newid())");
entity.Property(e => e.CreatedAt)
.HasDefaultValueSql("(getdate())")
.HasColumnType("datetime");
entity.Property(e => e.Description).HasMaxLength(512);
entity.Property(e => e.UpdatedAt).HasColumnType("datetime");
entity.HasOne(d => d.PostedBy).WithMany(p => p.BreweryPosts)
.HasForeignKey(d => d.PostedByID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_BreweryPost_UserAccount");
});
modelBuilder.Entity<BreweryPostPhoto>(entity =>
{
entity.ToTable("BreweryPostPhoto");
entity.HasIndex(e => new { e.BreweryPostID, e.PhotoID }, "IX_BreweryPostPhoto_BreweryPost_Photo");
entity.HasIndex(e => new { e.PhotoID, e.BreweryPostID }, "IX_BreweryPostPhoto_Photo_BreweryPost");
entity.Property(e => e.BreweryPostPhotoID).HasDefaultValueSql("(newid())");
entity.Property(e => e.LinkedAt)
.HasDefaultValueSql("(getdate())")
.HasColumnType("datetime");
entity.HasOne(d => d.BreweryPost).WithMany(p => p.BreweryPostPhotos)
.HasForeignKey(d => d.BreweryPostID)
.HasConstraintName("FK_BreweryPostPhoto_BreweryPost");
entity.HasOne(d => d.Photo).WithMany(p => p.BreweryPostPhotos)
.HasForeignKey(d => d.PhotoID)
.HasConstraintName("FK_BreweryPostPhoto_Photo");
});
modelBuilder.Entity<Comment>(entity =>
{
entity.HasKey(e => e.CommentID).HasName("PK_CommentID");
entity.ToTable("Comment");
entity.HasIndex(e => e.PostedByID, "IX_Comment_PostedByID");
entity.Property(e => e.CommentID).HasDefaultValueSql("(newid())");
entity.Property(e => e.CommentText).HasMaxLength(512);
entity.HasOne(d => d.PostedBy).WithMany(p => p.Comments)
.HasForeignKey(d => d.PostedByID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_PostedByID");
});
modelBuilder.Entity<Photo>(entity =>
{
entity.ToTable("Photo");
entity.HasIndex(e => e.UploadedByID, "IX_Photo_UploadedByID");
entity.Property(e => e.PhotoID).HasDefaultValueSql("(newid())");
entity.Property(e => e.Hyperlink).HasMaxLength(256);
entity.Property(e => e.UploadedAt)
.HasDefaultValueSql("(getdate())")
.HasColumnType("datetime");
entity.HasOne(d => d.UploadedBy).WithMany(p => p.Photos)
.HasForeignKey(d => d.UploadedByID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_Photo_UploadedBy");
});
modelBuilder.Entity<UserAccount>(entity =>
{
entity.ToTable("UserAccount");
entity.HasIndex(e => e.Email, "AK_Email").IsUnique();
entity.HasIndex(e => e.Username, "AK_Username").IsUnique();
entity.Property(e => e.UserAccountID).HasDefaultValueSql("(newid())");
entity.Property(e => e.CreatedAt).HasColumnType("datetime");
entity.Property(e => e.DateOfBirth).HasColumnType("datetime");
entity.Property(e => e.Email)
.HasMaxLength(128)
.IsUnicode(false);
entity.Property(e => e.FirstName).HasMaxLength(128);
entity.Property(e => e.LastName).HasMaxLength(128);
entity.Property(e => e.UpdatedAt).HasColumnType("datetime");
entity.Property(e => e.Username)
.HasMaxLength(64)
.IsUnicode(false);
});
modelBuilder.Entity<UserAvatar>(entity =>
{
entity.ToTable("UserAvatar");
entity.HasIndex(e => e.UserAccountID, "AK_UserAvatar_UserAccountID").IsUnique();
entity.HasIndex(e => e.UserAccountID, "IX_UserAvatar_UserAccount");
entity.Property(e => e.UserAvatarID).HasDefaultValueSql("(newid())");
entity.HasOne(d => d.Photo).WithMany(p => p.UserAvatars)
.HasForeignKey(d => d.PhotoID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_UserAvatar_PhotoID");
entity.HasOne(d => d.UserAccount).WithOne(p => p.UserAvatar)
.HasForeignKey<UserAvatar>(d => d.UserAccountID)
.HasConstraintName("FK_UserAvatar_UserAccount");
});
modelBuilder.Entity<UserCredential>(entity =>
{
entity.ToTable("UserCredential");
entity.HasIndex(e => e.UserAccountID, "AK_UserCredential_UserAccountID").IsUnique();
entity.HasIndex(e => e.UserAccountID, "IX_UserCredential_UserAccount");
entity.Property(e => e.UserCredentialID).HasDefaultValueSql("(newid())");
entity.Property(e => e.CreatedAt)
.HasDefaultValueSql("(getdate())")
.HasColumnType("datetime");
entity.Property(e => e.Expiry)
.HasDefaultValueSql("(dateadd(day,(90),getdate()))")
.HasColumnType("datetime");
entity.Property(e => e.Hash).HasMaxLength(100);
entity.HasOne(d => d.UserAccount).WithOne(p => p.UserCredential)
.HasForeignKey<UserCredential>(d => d.UserAccountID)
.HasConstraintName("FK_UserCredential_UserAccount");
});
modelBuilder.Entity<UserFollow>(entity =>
{
entity.ToTable("UserFollow");
entity.HasIndex(e => new { e.FollowingID, e.UserAccountID }, "IX_UserFollow_FollowingID_UserAccount");
entity.HasIndex(e => new { e.UserAccountID, e.FollowingID }, "IX_UserFollow_UserAccount_FollowingID");
entity.Property(e => e.UserFollowID).HasDefaultValueSql("(newid())");
entity.Property(e => e.CreatedAt)
.HasDefaultValueSql("(getdate())")
.HasColumnType("datetime");
entity.HasOne(d => d.Following).WithMany(p => p.UserFollowFollowings)
.HasForeignKey(d => d.FollowingID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_UserFollow_UserAccountFollowing");
entity.HasOne(d => d.UserAccount).WithMany(p => p.UserFollowUserAccounts)
.HasForeignKey(d => d.UserAccountID)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_UserFollow_UserAccount");
});
modelBuilder.Entity<UserVerification>(entity =>
{
entity.ToTable("UserVerification");
entity.HasIndex(e => e.UserAccountID, "AK_UserVerification_UserAccountID").IsUnique();
entity.HasIndex(e => e.UserAccountID, "IX_UserVerification_UserAccount");
entity.Property(e => e.UserVerificationID).HasDefaultValueSql("(newid())");
entity.Property(e => e.VerificationDateTime)
.HasDefaultValueSql("(getdate())")
.HasColumnType("datetime");
entity.HasOne(d => d.UserAccount).WithOne(p => p.UserVerification)
.HasForeignKey<UserVerification>(d => d.UserAccountID)
.HasConstraintName("FK_UserVerification_UserAccount");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class BreweryPost
{
public Guid BreweryPostID { get; set; }
public Guid PostedByID { get; set; }
public string Description { get; set; } = null!;
public DateTime CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public virtual ICollection<BeerPost> BeerPosts { get; set; } = new List<BeerPost>();
public virtual ICollection<BreweryPostPhoto> BreweryPostPhotos { get; set; } = new List<BreweryPostPhoto>();
public virtual UserAccount PostedBy { get; set; } = null!;
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class BreweryPostPhoto
{
public Guid BreweryPostPhotoID { get; set; }
public Guid BreweryPostID { get; set; }
public Guid PhotoID { get; set; }
public DateTime LinkedAt { get; set; }
public virtual BreweryPost BreweryPost { get; set; } = null!;
public virtual Photo Photo { get; set; } = null!;
}

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class Comment
{
public Guid CommentID { get; set; }
public string? CommentText { get; set; }
public Guid PostedByID { get; set; }
public virtual UserAccount PostedBy { get; set; } = null!;
}

View File

@@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>DataAccessLayer</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class Photo
{
public Guid PhotoID { get; set; }
public string? Hyperlink { get; set; }
public Guid UploadedByID { get; set; }
public DateTime UploadedAt { get; set; }
public virtual ICollection<BeerPostPhoto> BeerPostPhotos { get; set; } = new List<BeerPostPhoto>();
public virtual ICollection<BreweryPostPhoto> BreweryPostPhotos { get; set; } = new List<BreweryPostPhoto>();
public virtual UserAccount UploadedBy { get; set; } = null!;
public virtual ICollection<UserAvatar> UserAvatars { get; set; } = new List<UserAvatar>();
}

View File

@@ -1,41 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class UserAccount
{
public Guid UserAccountID { get; set; }
public string Username { get; set; } = null!;
public string FirstName { get; set; } = null!;
public string LastName { get; set; } = null!;
public string Email { get; set; } = null!;
public DateTime CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public DateTime DateOfBirth { get; set; }
public virtual ICollection<BeerPost> BeerPosts { get; set; } = new List<BeerPost>();
public virtual ICollection<BreweryPost> BreweryPosts { get; set; } = new List<BreweryPost>();
public virtual ICollection<Comment> Comments { get; set; } = new List<Comment>();
public virtual ICollection<Photo> Photos { get; set; } = new List<Photo>();
public virtual UserAvatar? UserAvatar { get; set; }
public virtual UserCredential? UserCredential { get; set; }
public virtual ICollection<UserFollow> UserFollowFollowings { get; set; } = new List<UserFollow>();
public virtual ICollection<UserFollow> UserFollowUserAccounts { get; set; } = new List<UserFollow>();
public virtual UserVerification? UserVerification { get; set; }
}

View File

@@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class UserAvatar
{
public Guid UserAvatarID { get; set; }
public Guid UserAccountID { get; set; }
public Guid PhotoID { get; set; }
public virtual Photo Photo { get; set; } = null!;
public virtual UserAccount UserAccount { get; set; } = null!;
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class UserCredential
{
public Guid UserCredentialID { get; set; }
public Guid UserAccountID { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime Expiry { get; set; }
public string Hash { get; set; } = null!;
public virtual UserAccount UserAccount { get; set; } = null!;
}

View File

@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class UserFollow
{
public Guid UserFollowID { get; set; }
public Guid UserAccountID { get; set; }
public Guid FollowingID { get; set; }
public DateTime CreatedAt { get; set; }
public virtual UserAccount Following { get; set; } = null!;
public virtual UserAccount UserAccount { get; set; } = null!;
}

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
namespace DataAccessLayer;
public partial class UserVerification
{
public Guid UserVerificationID { get; set; }
public Guid UserAccountID { get; set; }
public DateTime VerificationDateTime { get; set; }
public virtual UserAccount UserAccount { get; set; } = null!;
}

View File

@@ -7,6 +7,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccessLayer", "DataAcce
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccessLayer-Tests", "DataAccessLayer-Tests\DataAccessLayer-Tests.csproj", "{3638DC4E-D4C8-4DBE-CF3B-EF2C805509CE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
ProjectSection(SolutionItems) = preProject
schema.sql = schema.sql
test-data.sql = test-data.sql
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View File

@@ -41,6 +41,8 @@ CREATE TABLE UserAccount
DateOfBirth DATETIME NOT NULL,
Timer ROWVERSION,
CONSTRAINT PK_UserAccount
PRIMARY KEY (UserAccountID),
@@ -51,27 +53,6 @@ CREATE TABLE UserAccount
UNIQUE (Email),
);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
CREATE TABLE Comment
(
CommentID UNIQUEIDENTIFIER
CONSTRAINT DF_CommentID DEFAULT NEWID(),
CommentText NVARCHAR(512),
PostedByID UNIQUEIDENTIFIER NOT NULL,
CONSTRAINT PK_CommentID
PRIMARY KEY (CommentID),
CONSTRAINT FK_PostedByID
FOREIGN KEY (PostedByID) REFERENCES UserAccount(UserAccountID),
)
CREATE NONCLUSTERED INDEX IX_Comment_PostedByID
ON Comment(PostedByID);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
@@ -88,6 +69,8 @@ CREATE TABLE Photo -- All photos must be linked to a user account, you cannot de
UploadedAt DATETIME NOT NULL
CONSTRAINT DF_Photo_UploadedAt DEFAULT GETDATE(),
Timer ROWVERSION,
CONSTRAINT PK_Photo
PRIMARY KEY (PhotoID),
@@ -112,6 +95,8 @@ CREATE TABLE UserAvatar -- delete avatar photo when user account is deleted
PhotoID UNIQUEIDENTIFIER NOT NULL,
Timer ROWVERSION,
CONSTRAINT PK_UserAvatar PRIMARY KEY (UserAvatarID),
CONSTRAINT FK_UserAvatar_UserAccount
@@ -144,6 +129,8 @@ CREATE TABLE UserVerification -- delete verification data when user account is d
CONSTRAINT DF_VerificationDateTime
DEFAULT GETDATE(),
Timer ROWVERSION,
CONSTRAINT PK_UserVerification
PRIMARY KEY (UserVerificationID),
@@ -178,6 +165,8 @@ CREATE TABLE UserCredential -- delete credentials when user account is deleted
Hash NVARCHAR(100) NOT NULL,
-- uses argon2
Timer ROWVERSION,
CONSTRAINT PK_UserCredential
PRIMARY KEY (UserCredentialID),
@@ -208,6 +197,8 @@ CREATE TABLE UserFollow
CreatedAt DATETIME
CONSTRAINT DF_UserFollow_CreatedAt DEFAULT GETDATE() NOT NULL,
Timer ROWVERSION,
CONSTRAINT PK_UserFollow
PRIMARY KEY (UserFollowID),
@@ -229,6 +220,67 @@ CREATE NONCLUSTERED INDEX IX_UserFollow_UserAccount_FollowingID
CREATE NONCLUSTERED INDEX IX_UserFollow_FollowingID_UserAccount
ON UserFollow(FollowingID, UserAccountID);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
CREATE TABLE Country
(
CountryID UNIQUEIDENTIFIER
CONSTRAINT DF_CountryID DEFAULT NEWID(),
CountryName NVARCHAR(100) NOT NULL,
CountryCode CHAR(3) NOT NULL,
Timer ROWVERSION,
CONSTRAINT PK_Country
PRIMARY KEY (CountryID),
);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
CREATE TABLE StateProvince
(
StateProvinceID UNIQUEIDENTIFIER
CONSTRAINT DF_StateProvinceID DEFAULT NEWID(),
StateProvinceName NVARCHAR(100) NOT NULL,
CountryID UNIQUEIDENTIFIER NOT NULL,
Timer ROWVERSION,
CONSTRAINT PK_StateProvince
PRIMARY KEY (StateProvinceID),
CONSTRAINT FK_StateProvince_Country
FOREIGN KEY (CountryID)
REFERENCES Country(CountryID)
);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
CREATE TABLE City
(
CityID UNIQUEIDENTIFIER
CONSTRAINT DF_CityID DEFAULT NEWID(),
CityName NVARCHAR(100) NOT NULL,
StateProvinceID UNIQUEIDENTIFIER NOT NULL,
Timer ROWVERSION,
CONSTRAINT PK_City
PRIMARY KEY (CityID),
);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
@@ -246,6 +298,12 @@ CREATE TABLE BreweryPost -- A user cannot be deleted if they have a post
UpdatedAt DATETIME NULL,
Timer ROWVERSION,
CityID UNIQUEIDENTIFIER NOT NULL,
Coordinates GEOGRAPHY NOT NULL,
CONSTRAINT PK_BreweryPost
PRIMARY KEY (BreweryPostID),
@@ -258,9 +316,9 @@ CREATE TABLE BreweryPost -- A user cannot be deleted if they have a post
CREATE NONCLUSTERED INDEX IX_BreweryPost_PostedByID
ON BreweryPost(PostedByID);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------------------------------------------------------------
----------------------------------------------------------------------------
CREATE TABLE BreweryPostPhoto -- All photos linked to a post are deleted if the post is deleted
(
BreweryPostPhotoID UNIQUEIDENTIFIER
@@ -273,6 +331,8 @@ CREATE TABLE BreweryPostPhoto -- All photos linked to a post are deleted if the
LinkedAt DATETIME NOT NULL
CONSTRAINT DF_BreweryPostPhoto_LinkedAt DEFAULT GETDATE(),
Timer ROWVERSION,
CONSTRAINT PK_BreweryPostPhoto
PRIMARY KEY (BreweryPostPhotoID),
@@ -304,6 +364,8 @@ CREATE TABLE BeerStyle
Description NVARCHAR(MAX),
Timer ROWVERSION,
CONSTRAINT PK_BeerStyle
PRIMARY KEY (BeerStyleID),
@@ -340,6 +402,8 @@ CREATE TABLE BeerPost
UpdatedAt DATETIME,
Timer ROWVERSION,
CONSTRAINT PK_BeerPost
PRIMARY KEY (BeerPostID),
@@ -386,6 +450,8 @@ CREATE TABLE BeerPostPhoto -- All photos linked to a beer post are deleted if th
LinkedAt DATETIME NOT NULL
CONSTRAINT DF_BeerPostPhoto_LinkedAt DEFAULT GETDATE(),
Timer ROWVERSION,
CONSTRAINT PK_BeerPostPhoto
PRIMARY KEY (BeerPostPhotoID),
@@ -409,10 +475,36 @@ ON BeerPostPhoto(BeerPostID, PhotoID);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
CREATE TABLE BeerPostComment
(
BeerPostCommentID UNIQUEIDENTIFIER
CONSTRAINT DF_BeerPostComment DEFAULT NEWID(),
Comment NVARCHAR(250) NOT NULL,
BeerPostID UNIQUEIDENTIFIER NOT NULL,
Rating INT NOT NULL,
Timer ROWVERSION,
CONSTRAINT PK_BeerPostComment
PRIMARY KEY (BeerPostCommentID),
CONSTRAINT FK_BeerPostComment_BeerPost
FOREIGN KEY (BeerPostID) REFERENCES BeerPost(BeerPostID)
)
CREATE NONCLUSTERED INDEX IX_BeerPostComment_BeerPost
ON BeerPostComment(BeerPostID)
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
/*
Install-Package Microsoft.EntityFrameworkCore.SqlServer
Install-Package Microsoft.EntityFrameworkCore.Tools
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.Tools
Scaffold-DbContext "Server=(localdb)\ProjectModels;Database=Biergarten;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -Context BiergartenContext -UseDatabaseNames -Force
Scaffold-DbContext "Data Source=AARONPC\INFO5052;Integrated Security=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Database=Biergarten" Microsoft.EntityFrameworkCore.SqlServer -Context BiergartenContext -ContextDir "." -OutputDir "Entities" -UseDatabaseNames -Force
*/

View File

@@ -1,7 +1,6 @@
USE Biergarten;
-- User Account Variables (30 users)
DECLARE
@user1 UNIQUEIDENTIFIER = NEWID(),
@user2 UNIQUEIDENTIFIER = NEWID(),
@@ -34,7 +33,6 @@ DECLARE
@user29 UNIQUEIDENTIFIER = NEWID(),
@user30 UNIQUEIDENTIFIER = NEWID(),
-- BeerStyle Variables (13 styles)
@ipa UNIQUEIDENTIFIER = NEWID(),
@stout UNIQUEIDENTIFIER = NEWID(),
@lager UNIQUEIDENTIFIER = NEWID(),
@@ -49,7 +47,6 @@ DECLARE
@brown UNIQUEIDENTIFIER = NEWID(),
@barleywine UNIQUEIDENTIFIER = NEWID(),
-- Photo Variables (40 photos)
@photo1 UNIQUEIDENTIFIER = NEWID(),
@photo2 UNIQUEIDENTIFIER = NEWID(),
@photo3 UNIQUEIDENTIFIER = NEWID(),
@@ -91,7 +88,6 @@ DECLARE
@photo39 UNIQUEIDENTIFIER = NEWID(),
@photo40 UNIQUEIDENTIFIER = NEWID(),
-- BreweryPost Variables (15 breweries)
@brewery1 UNIQUEIDENTIFIER = NEWID(),
@brewery2 UNIQUEIDENTIFIER = NEWID(),
@brewery3 UNIQUEIDENTIFIER = NEWID(),
@@ -108,7 +104,6 @@ DECLARE
@brewery14 UNIQUEIDENTIFIER = NEWID(),
@brewery15 UNIQUEIDENTIFIER = NEWID(),
-- BeerPost Variables (28 beers)
@beer1 UNIQUEIDENTIFIER = NEWID(),
@beer2 UNIQUEIDENTIFIER = NEWID(),
@beer3 UNIQUEIDENTIFIER = NEWID(),
@@ -138,57 +133,39 @@ DECLARE
@beer27 UNIQUEIDENTIFIER = NEWID(),
@beer28 UNIQUEIDENTIFIER = NEWID(),
-- Rating Variables (50 ratings)
@rating1 UNIQUEIDENTIFIER = NEWID(),
@rating2 UNIQUEIDENTIFIER = NEWID(),
@rating3 UNIQUEIDENTIFIER = NEWID(),
@rating4 UNIQUEIDENTIFIER = NEWID(),
@rating5 UNIQUEIDENTIFIER = NEWID(),
@rating6 UNIQUEIDENTIFIER = NEWID(),
@rating7 UNIQUEIDENTIFIER = NEWID(),
@rating8 UNIQUEIDENTIFIER = NEWID(),
@rating9 UNIQUEIDENTIFIER = NEWID(),
@rating10 UNIQUEIDENTIFIER = NEWID(),
@rating11 UNIQUEIDENTIFIER = NEWID(),
@rating12 UNIQUEIDENTIFIER = NEWID(),
@rating13 UNIQUEIDENTIFIER = NEWID(),
@rating14 UNIQUEIDENTIFIER = NEWID(),
@rating15 UNIQUEIDENTIFIER = NEWID(),
@rating16 UNIQUEIDENTIFIER = NEWID(),
@rating17 UNIQUEIDENTIFIER = NEWID(),
@rating18 UNIQUEIDENTIFIER = NEWID(),
@rating19 UNIQUEIDENTIFIER = NEWID(),
@rating20 UNIQUEIDENTIFIER = NEWID(),
@rating21 UNIQUEIDENTIFIER = NEWID(),
@rating22 UNIQUEIDENTIFIER = NEWID(),
@rating23 UNIQUEIDENTIFIER = NEWID(),
@rating24 UNIQUEIDENTIFIER = NEWID(),
@rating25 UNIQUEIDENTIFIER = NEWID(),
@rating26 UNIQUEIDENTIFIER = NEWID(),
@rating27 UNIQUEIDENTIFIER = NEWID(),
@rating28 UNIQUEIDENTIFIER = NEWID(),
@rating29 UNIQUEIDENTIFIER = NEWID(),
@rating30 UNIQUEIDENTIFIER = NEWID(),
@rating31 UNIQUEIDENTIFIER = NEWID(),
@rating32 UNIQUEIDENTIFIER = NEWID(),
@rating33 UNIQUEIDENTIFIER = NEWID(),
@rating34 UNIQUEIDENTIFIER = NEWID(),
@rating35 UNIQUEIDENTIFIER = NEWID(),
@rating36 UNIQUEIDENTIFIER = NEWID(),
@rating37 UNIQUEIDENTIFIER = NEWID(),
@rating38 UNIQUEIDENTIFIER = NEWID(),
@rating39 UNIQUEIDENTIFIER = NEWID(),
@rating40 UNIQUEIDENTIFIER = NEWID(),
@rating41 UNIQUEIDENTIFIER = NEWID(),
@rating42 UNIQUEIDENTIFIER = NEWID(),
@rating43 UNIQUEIDENTIFIER = NEWID(),
@rating44 UNIQUEIDENTIFIER = NEWID(),
@rating45 UNIQUEIDENTIFIER = NEWID(),
@rating46 UNIQUEIDENTIFIER = NEWID(),
@rating47 UNIQUEIDENTIFIER = NEWID(),
@rating48 UNIQUEIDENTIFIER = NEWID(),
@rating49 UNIQUEIDENTIFIER = NEWID(),
@rating50 UNIQUEIDENTIFIER = NEWID();
@countryUSA UNIQUEIDENTIFIER = NEWID(),
@stateOregon UNIQUEIDENTIFIER = NEWID(),
@stateMichigan UNIQUEIDENTIFIER = NEWID(),
@stateCalifornia UNIQUEIDENTIFIER = NEWID(),
@stateColorado UNIQUEIDENTIFIER = NEWID(),
@stateWashington UNIQUEIDENTIFIER = NEWID(),
@stateIllinois UNIQUEIDENTIFIER = NEWID(),
@stateNewYork UNIQUEIDENTIFIER = NEWID(),
@stateTexas UNIQUEIDENTIFIER = NEWID(),
@stateMassachusetts UNIQUEIDENTIFIER = NEWID(),
@statePennsylvania UNIQUEIDENTIFIER = NEWID(),
@stateNorthCarolina UNIQUEIDENTIFIER = NEWID(),
@stateGeorgia UNIQUEIDENTIFIER = NEWID(),
@stateOhio UNIQUEIDENTIFIER = NEWID(),
@stateMissouri UNIQUEIDENTIFIER = NEWID(),
@stateVirginia UNIQUEIDENTIFIER = NEWID(),
@cityPortland UNIQUEIDENTIFIER = NEWID(),
@cityGrandRapids UNIQUEIDENTIFIER = NEWID(),
@citySanFrancisco UNIQUEIDENTIFIER = NEWID(),
@cityDenver UNIQUEIDENTIFIER = NEWID(),
@citySeattle UNIQUEIDENTIFIER = NEWID(),
@cityChicago UNIQUEIDENTIFIER = NEWID(),
@cityBrooklyn UNIQUEIDENTIFIER = NEWID(),
@cityAustin UNIQUEIDENTIFIER = NEWID(),
@cityBoston UNIQUEIDENTIFIER = NEWID(),
@cityPhiladelphia UNIQUEIDENTIFIER = NEWID(),
@cityAsheville UNIQUEIDENTIFIER = NEWID(),
@cityAtlanta UNIQUEIDENTIFIER = NEWID(),
@cityColumbus UNIQUEIDENTIFIER = NEWID(),
@cityKansasCity UNIQUEIDENTIFIER = NEWID(),
@cityRichmond UNIQUEIDENTIFIER = NEWID();
----------------------------------------------------------------------------
-- UserAccount (30 users)
@@ -252,7 +229,6 @@ VALUES
(@barleywine, 'Barleywine', 'Strong ale with intense malt flavors and high alcohol content.');
COMMIT TRANSACTION;
----------------------------------------------------------------------------
-- UserCredential (28 credentials)
----------------------------------------------------------------------------
@@ -439,28 +415,88 @@ VALUES
COMMIT TRANSACTION;
-- Country (1 country)
----------------------------------------------------------------------------
BEGIN TRANSACTION;
INSERT INTO dbo.Country
(CountryID, CountryName, CountryCode)
VALUES
(@countryUSA, 'United States', 'USA');
COMMIT TRANSACTION;
----------------------------------------------------------------------------
-- StateProvince (15 states/provinces)
----------------------------------------------------------------------------
BEGIN TRANSACTION;
INSERT INTO dbo.StateProvince
(StateProvinceID, StateProvinceName, CountryID)
VALUES
(@stateOregon, 'Oregon', @countryUSA),
(@stateMichigan, 'Michigan', @countryUSA),
(@stateCalifornia, 'California', @countryUSA),
(@stateColorado, 'Colorado', @countryUSA),
(@stateWashington, 'Washington', @countryUSA),
(@stateIllinois, 'Illinois', @countryUSA),
(@stateNewYork, 'New York', @countryUSA),
(@stateTexas, 'Texas', @countryUSA),
(@stateMassachusetts, 'Massachusetts', @countryUSA),
(@statePennsylvania, 'Pennsylvania', @countryUSA),
(@stateNorthCarolina, 'North Carolina', @countryUSA),
(@stateGeorgia, 'Georgia', @countryUSA),
(@stateOhio, 'Ohio', @countryUSA),
(@stateMissouri, 'Missouri', @countryUSA),
(@stateVirginia, 'Virginia', @countryUSA);
COMMIT TRANSACTION;
----------------------------------------------------------------------------
-- City (15 cities)
----------------------------------------------------------------------------
BEGIN TRANSACTION;
INSERT INTO dbo.City
(CityID, CityName, StateProvinceID)
VALUES
(@cityPortland, 'Portland', @stateOregon),
(@cityGrandRapids, 'Grand Rapids', @stateMichigan),
(@citySanFrancisco, 'San Francisco', @stateCalifornia),
(@cityDenver, 'Denver', @stateColorado),
(@citySeattle, 'Seattle', @stateWashington),
(@cityChicago, 'Chicago', @stateIllinois),
(@cityBrooklyn, 'Brooklyn', @stateNewYork),
(@cityAustin, 'Austin', @stateTexas),
(@cityBoston, 'Boston', @stateMassachusetts),
(@cityPhiladelphia, 'Philadelphia', @statePennsylvania),
(@cityAsheville, 'Asheville', @stateNorthCarolina),
(@cityAtlanta, 'Atlanta', @stateGeorgia),
(@cityColumbus, 'Columbus', @stateOhio),
(@cityKansasCity, 'Kansas City', @stateMissouri),
(@cityRichmond, 'Richmond', @stateVirginia);
COMMIT TRANSACTION;
----------------------------------------------------------------------------
-- BreweryPost (15 breweries)
----------------------------------------------------------------------------
BEGIN TRANSACTION;
INSERT INTO dbo.BreweryPost
(BreweryPostID, PostedByID, Description, CreatedAt)
(BreweryPostID, PostedByID, Description, CreatedAt, UpdatedAt, CityID, Coordinates)
VALUES
(@brewery1, @user1, 'Hoppy Trails Brewery - Crafting exceptional IPAs since 2020. Located in the heart of Portland.', '2023-02-01'),
(@brewery2, @user2, 'Dark Horse Brewing Co. - Specializing in rich stouts and porters. Family owned and operated.', '2023-03-01'),
(@brewery3, @user3, 'Golden Gate Lager House - Traditional German-style lagers brewed with precision.', '2023-04-01'),
(@brewery4, @user5, 'Mountain View Ales - High-altitude brewing for unique flavor profiles.', '2023-05-15'),
(@brewery5, @user6, 'Coastal Wheat Works - Refreshing wheat beers perfect for any season.', '2023-06-20'),
(@brewery6, @user9, 'Riverside Porter Factory - Classic porters with a modern twist.', '2023-08-10'),
(@brewery7, @user11, 'Sunset Sour Cellars - Experimental sour ales aged in oak barrels.', '2024-01-20'),
(@brewery8, @user14, 'Urban Craft Collective - Community-focused brewery with rotating seasonal offerings.', '2024-05-10'),
(@brewery9, @user4, 'Belgian House - Authentic Belgian brewing traditions in the heart of the city.', '2024-06-01'),
(@brewery10, @user18, 'Amber Fields Brewery - Celebrating the richness of amber ales and maltier styles.', '2024-08-15'),
(@brewery11, @user20, 'Farmhouse Funk - Specializing in saisons and wild fermented ales.', '2024-09-20'),
(@brewery12, @user24, 'Brown Bear Brewing - Cozy taproom featuring award-winning brown ales.', '2025-01-10'),
(@brewery13, @user27, 'Vintage Vats - Small-batch barleywines and aged strong ales.', '2025-02-25'),
(@brewery14, @user12, 'Hop Haven - Experimental IPAs and cutting-edge hop varieties.', '2024-10-05'),
(@brewery15, @user8, 'Barrel & Grain - Farm-to-glass brewery using locally sourced ingredients.', '2024-04-20');
(@brewery1, @user1, 'Hoppy Trails Brewery - Crafting exceptional IPAs since 2020. Located in the heart of Portland.', '2023-02-01', NULL, @cityPortland, GEOGRAPHY::Point(45.5152, -122.6784, 4326)),
(@brewery2, @user2, 'Dark Horse Brewing Co. - Specializing in rich stouts and porters. Family owned and operated.', '2023-03-01', NULL, @cityGrandRapids, GEOGRAPHY::Point(42.9634, -85.6681, 4326)),
(@brewery3, @user3, 'Golden Gate Lager House - Traditional German-style lagers brewed with precision.', '2023-04-01', NULL, @citySanFrancisco, GEOGRAPHY::Point(37.7749, -122.4194, 4326)),
(@brewery4, @user5, 'Mountain View Ales - High-altitude brewing for unique flavor profiles.', '2023-05-15', NULL, @cityDenver, GEOGRAPHY::Point(39.7392, -104.9903, 4326)),
(@brewery5, @user6, 'Coastal Wheat Works - Refreshing wheat beers perfect for any season.', '2023-06-20', NULL, @citySeattle, GEOGRAPHY::Point(47.6062, -122.3321, 4326)),
(@brewery6, @user9, 'Riverside Porter Factory - Classic porters with a modern twist.', '2023-08-10', NULL, @cityChicago, GEOGRAPHY::Point(41.8781, -87.6298, 4326)),
(@brewery7, @user11, 'Sunset Sour Cellars - Experimental sour ales aged in oak barrels.', '2024-01-20', '2024-08-12', @cityBrooklyn, GEOGRAPHY::Point(40.6782, -73.9442, 4326)),
(@brewery8, @user14, 'Urban Craft Collective - Community-focused brewery with rotating seasonal offerings.', '2024-05-10', NULL, @cityAustin, GEOGRAPHY::Point(30.2672, -97.7431, 4326)),
(@brewery9, @user4, 'Belgian House - Authentic Belgian brewing traditions in the heart of the city.', '2024-06-01', NULL, @cityBoston, GEOGRAPHY::Point(42.3601, -71.0589, 4326)),
(@brewery10, @user18, 'Amber Fields Brewery - Celebrating the richness of amber ales and maltier styles.', '2024-08-15', NULL, @cityPhiladelphia, GEOGRAPHY::Point(39.9526, -75.1652, 4326)),
(@brewery11, @user20, 'Farmhouse Funk - Specializing in saisons and wild fermented ales.', '2024-09-20', NULL, @cityAsheville, GEOGRAPHY::Point(35.5951, -82.5515, 4326)),
(@brewery12, @user24, 'Brown Bear Brewing - Cozy taproom featuring award-winning brown ales.', '2025-01-10', NULL, @cityAtlanta, GEOGRAPHY::Point(33.7490, -84.3880, 4326)),
(@brewery13, @user27, 'Vintage Vats - Small-batch barleywines and aged strong ales.', '2025-02-25', NULL, @cityColumbus, GEOGRAPHY::Point(39.9612, -82.9988, 4326)),
(@brewery14, @user12, 'Hop Haven - Experimental IPAs and cutting-edge hop varieties.', '2024-10-05', NULL, @cityKansasCity, GEOGRAPHY::Point(39.0997, -94.5786, 4326)),
(@brewery15, @user8, 'Barrel & Grain - Farm-to-glass brewery using locally sourced ingredients.', '2024-04-20', NULL, @cityRichmond, GEOGRAPHY::Point(37.5407, -77.4360, 4326));
COMMIT TRANSACTION;
@@ -553,134 +589,6 @@ VALUES
COMMIT TRANSACTION;
----------------------------------------------------------------------------
-- Rating (50 ratings)
----------------------------------------------------------------------------
BEGIN TRANSACTION;
INSERT INTO dbo.Rating
(RatingID, Score, RatedByID)
VALUES
(@rating1, 5, @user2),
(@rating2, 4, @user3),
(@rating3, 5, @user4),
(@rating4, 3, @user5),
(@rating5, 4, @user6),
(@rating6, 5, @user7),
(@rating7, 4, @user8),
(@rating8, 5, @user9),
(@rating9, 3, @user10),
(@rating10, 4, @user11),
(@rating11, 5, @user12),
(@rating12, 4, @user13),
(@rating13, 5, @user14),
(@rating14, 3, @user15),
(@rating15, 4, @user16),
(@rating16, 5, @user17),
(@rating17, 4, @user18),
(@rating18, 5, @user19),
(@rating19, 3, @user20),
(@rating20, 4, @user21),
(@rating21, 5, @user22),
(@rating22, 4, @user23),
(@rating23, 5, @user24),
(@rating24, 3, @user25),
(@rating25, 4, @user26),
(@rating26, 5, @user27),
(@rating27, 4, @user28),
(@rating28, 5, @user29),
(@rating29, 3, @user30),
(@rating30, 4, @user1),
(@rating31, 5, @user3),
(@rating32, 4, @user4),
(@rating33, 5, @user6),
(@rating34, 3, @user8),
(@rating35, 4, @user9),
(@rating36, 5, @user10),
(@rating37, 4, @user11),
(@rating38, 5, @user13),
(@rating39, 3, @user14),
(@rating40, 4, @user15),
(@rating41, 5, @user16),
(@rating42, 4, @user17),
(@rating43, 5, @user18),
(@rating44, 3, @user19),
(@rating45, 4, @user20),
(@rating46, 5, @user21),
(@rating47, 4, @user22),
(@rating48, 5, @user23),
(@rating49, 3, @user24),
(@rating50, 4, @user25);
COMMIT TRANSACTION;
----------------------------------------------------------------------------
-- BeerPostComment (30 beer comments)
----------------------------------------------------------------------------
BEGIN TRANSACTION;
INSERT INTO dbo.BeerPostComment
(CommentText, PostedByID, RatingID)
VALUES
('This IPA is absolutely fantastic! Perfect balance of hops and malt.', @user2, @rating1),
('Love the citrus notes in this beer. Will definitely buy again!', @user3, @rating2),
('Rich and smooth stout. The chocolate flavor is amazing.', @user4, @rating3),
('Good lager, very refreshing on a hot day.', @user5, @rating4),
('Nice pale ale, but could use a bit more hop character.', @user6, @rating5),
('Best wheat beer I''ve had in a while!', @user7, @rating6),
('Solid porter with great roasted malt flavor.', @user8, @rating7),
('This sour ale is perfectly tart and refreshing.', @user9, @rating8),
('Decent pilsner, nothing special but drinkable.', @user10, @rating9),
('The double IPA lives up to its name - super hoppy!', @user11, @rating10),
('Vanilla porter is a unique and delicious combination.', @user12, @rating11),
('Classic hefeweizen with authentic Bavarian character.', @user13, @rating12),
('Belgian Bliss is truly blissful! Amazing complexity.', @user22, @rating21),
('Copper Crown has the perfect amber color and taste.', @user23, @rating22),
('This saison is incredibly refreshing and unique.', @user24, @rating23),
('Barleywine is a bit too strong for my taste.', @user25, @rating24),
('Love the citrus bomb! Perfect for IPA lovers.', @user26, @rating25),
('Mosaic Dream lives up to its name - dreamy!', @user27, @rating26),
('Farm fresh lager is exactly that - fresh and clean.', @user28, @rating27),
('Midnight Express gives me the perfect coffee kick.', @user29, @rating28),
('Harvest wheat is okay, but I prefer traditional wheats.', @user30, @rating29),
('Cherry sunset sour is perfectly balanced.', @user1, @rating30),
('Pacific Pale Ale brings back West Coast memories.', @user3, @rating31),
('Bohemian Pilsner is as authentic as it gets.', @user4, @rating32),
('Coffee porter is my new favorite breakfast beer!', @user6, @rating33),
('Wild ferment is interesting but not for everyone.', @user8, @rating34),
('Session IPA is perfect for summer afternoons.', @user9, @rating35),
('Nutty brown ale has incredible depth of flavor.', @user10, @rating36),
('Old Guardian is a masterpiece of brewing.', @user11, @rating37),
('Imperial Stout deserves all the awards.', @user13, @rating38);
COMMIT TRANSACTION;
----------------------------------------------------------------------------
-- BreweryPostComment (20 brewery comments)
----------------------------------------------------------------------------
BEGIN TRANSACTION;
INSERT INTO dbo.BreweryPostComment
(CommentText, PostedByID, RatingID)
VALUES
('Amazing brewery! The taproom has a great atmosphere.', @user14, @rating13),
('Love supporting local breweries like this one.', @user15, @rating14),
('Good selection of beers, but service could be better.', @user16, @rating15),
('Best brewery in the area, hands down!', @user17, @rating16),
('Nice facility and friendly staff. Will visit again.', @user18, @rating17),
('Great variety of beer styles. Something for everyone.', @user19, @rating18),
('Decent brewery but a bit pricey.', @user20, @rating19),
('Fantastic sour beer selection! Worth the trip.', @user21, @rating20),
('Belgian House has the most authentic Belgian beers outside Belgium!', @user14, @rating39),
('Amber Fields creates consistently excellent amber ales.', @user15, @rating40),
('Farmhouse Funk is a must-visit for sour beer enthusiasts.', @user16, @rating41),
('Brown Bear Brewing has a cozy atmosphere and great beer.', @user17, @rating42),
('Vintage Vats ages their beers to perfection.', @user18, @rating43),
('Hop Haven is always pushing boundaries with new hops.', @user19, @rating44),
('Barrel & Grain sources locally and it shows in quality.', @user20, @rating45),
('Hoppy Trails never disappoints with their IPAs.', @user21, @rating46),
('Dark Horse makes the best stouts in the region.', @user22, @rating47),
('Golden Gate Lager House is my -to for crisp lagers.', @user23, @rating48),
('Mountain View Ales has incredible views and incredible beer.', @user24, @rating49),
('Coastal Wheat Works perfects the art of wheat beer.', @user25, @rating50);
COMMIT TRANSACTION;
----------------------------------------------------------------------------