mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Refactor data layer, add business layer
This commit is contained in:
@@ -5,11 +5,14 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference
|
||||
Include="Konscious.Security.Cryptography.Argon2"
|
||||
Version="1.3.1"
|
||||
/>
|
||||
<PackageReference Include="dbup" Version="5.0.41" />
|
||||
<PackageReference Include="idunno.Password.Generator" Version="1.0.1" />
|
||||
<PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.1" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="scripts/**/*.sql" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
125
DataLayer/Program.cs
Normal file
125
DataLayer/Program.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System.Data;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using idunno.Password;
|
||||
using Konscious.Security.Cryptography;
|
||||
using Microsoft.Data.SqlClient;
|
||||
|
||||
/// <summary>
|
||||
/// Executes USP_AddUserCredentials to add missing user credentials using a table-valued parameter
|
||||
/// consisting of the user account id and a generated Argon2 hash.
|
||||
/// </summary>
|
||||
/// <param name="connection">An open SQL connection.</param>
|
||||
/// <param name="credentialTable">A table-valued parameter payload containing user IDs and hashes.</param>
|
||||
static async Task ExecuteCredentialProcedureAsync(SqlConnection connection, DataTable credentialTable)
|
||||
{
|
||||
await using var command = new SqlCommand("dbo.USP_AddUserCredentials", connection)
|
||||
{
|
||||
CommandType = CommandType.StoredProcedure
|
||||
};
|
||||
|
||||
// Must match your stored proc parameter name:
|
||||
var tvpParameter = command.Parameters.Add("@Hash", SqlDbType.Structured);
|
||||
tvpParameter.TypeName = "dbo.TblUserHashes";
|
||||
tvpParameter.Value = credentialTable;
|
||||
|
||||
await command.ExecuteNonQueryAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a DataTable of user account IDs and generated Argon2 password hashes for users that do not yet
|
||||
/// have credentials.
|
||||
/// </summary>
|
||||
/// <param name="connection">An open SQL connection.</param>
|
||||
/// <returns>A DataTable matching dbo.TblUserHashes with user IDs and hashes.</returns>
|
||||
static async Task<DataTable> BuildCredentialTableAsync(SqlConnection connection)
|
||||
{
|
||||
const string sql = """
|
||||
SELECT ua.UserAccountID
|
||||
FROM dbo.UserAccount AS ua
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM dbo.UserCredential AS uc
|
||||
WHERE uc.UserAccountID = ua.UserAccountID
|
||||
);
|
||||
""";
|
||||
|
||||
await using var command = new SqlCommand(sql, connection);
|
||||
await using var reader = await command.ExecuteReaderAsync();
|
||||
|
||||
// IMPORTANT: column names/types/order should match dbo.TblUserHashes
|
||||
var table = new DataTable();
|
||||
table.Columns.Add("UserAccountID", typeof(Guid));
|
||||
table.Columns.Add("Hash", typeof(string));
|
||||
|
||||
var generator = new PasswordGenerator();
|
||||
|
||||
while (await reader.ReadAsync())
|
||||
{
|
||||
Guid userId = reader.GetGuid(0);
|
||||
|
||||
// idunno.Password PasswordGenerator signature:
|
||||
// Generate(length, numberOfDigits, numberOfSymbols, noUpper, allowRepeat)
|
||||
string pwd = generator.Generate(
|
||||
length: 64,
|
||||
numberOfDigits: 10,
|
||||
numberOfSymbols: 10
|
||||
);
|
||||
|
||||
string hash = GeneratePasswordHash(pwd);
|
||||
|
||||
var row = table.NewRow();
|
||||
row["UserAccountID"] = userId;
|
||||
row["Hash"] = hash;
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates an Argon2id hash for the given password.
|
||||
/// </summary>
|
||||
/// <param name="pwd">The plaintext password.</param>
|
||||
/// <returns>A string in the format "base64(salt):base64(hash)".</returns>
|
||||
static string GeneratePasswordHash(string pwd)
|
||||
{
|
||||
byte[] salt = RandomNumberGenerator.GetBytes(16);
|
||||
|
||||
var argon2 = new Argon2id(Encoding.UTF8.GetBytes(pwd))
|
||||
{
|
||||
Salt = salt,
|
||||
DegreeOfParallelism = Math.Max(Environment.ProcessorCount, 1),
|
||||
MemorySize = 65536,
|
||||
Iterations = 4,
|
||||
};
|
||||
|
||||
byte[] hash = argon2.GetBytes(32);
|
||||
return $"{Convert.ToBase64String(salt)}:{Convert.ToBase64String(hash)}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the seed process to add test users and generate missing credentials.
|
||||
/// </summary>
|
||||
/// <param name="connection">An open SQL connection.</param>
|
||||
static async Task RunSeedAsync(SqlConnection connection)
|
||||
{
|
||||
//run add test users
|
||||
await using var insertCommand = new SqlCommand("dbo.USP_SeedTestUsers", connection)
|
||||
{
|
||||
CommandType = CommandType.StoredProcedure
|
||||
};
|
||||
await insertCommand.ExecuteNonQueryAsync();
|
||||
|
||||
Console.WriteLine("Inserted or refreshed test users.");
|
||||
|
||||
DataTable credentialRows = await BuildCredentialTableAsync(connection);
|
||||
if (credentialRows.Rows.Count == 0)
|
||||
{
|
||||
Console.WriteLine("No new credentials required.");
|
||||
return;
|
||||
}
|
||||
|
||||
await ExecuteCredentialProcedureAsync(connection, credentialRows);
|
||||
Console.WriteLine($"Generated {credentialRows.Rows.Count} credential hashes.");
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,559 +0,0 @@
|
||||
,name,city,state
|
||||
0,NorthGate Brewing ,Minneapolis, MN
|
||||
1,Against the Grain Brewery,Louisville, KY
|
||||
2,Jack's Abby Craft Lagers,Framingham, MA
|
||||
3,Mike Hess Brewing Company,San Diego, CA
|
||||
4,Fort Point Beer Company,San Francisco, CA
|
||||
5,COAST Brewing Company,Charleston, SC
|
||||
6,Great Divide Brewing Company,Denver, CO
|
||||
7,Tapistry Brewing,Bridgman, MI
|
||||
8,Big Lake Brewing,Holland, MI
|
||||
9,The Mitten Brewing Company,Grand Rapids, MI
|
||||
10,Brewery Vivant,Grand Rapids, MI
|
||||
11,Petoskey Brewing,Petoskey, MI
|
||||
12,Blackrocks Brewery,Marquette, MI
|
||||
13,Perrin Brewing Company,Comstock Park, MI
|
||||
14,Witch's Hat Brewing Company,South Lyon, MI
|
||||
15,Founders Brewing Company,Grand Rapids, MI
|
||||
16,Flat 12 Bierwerks,Indianapolis, IN
|
||||
17,Tin Man Brewing Company,Evansville, IN
|
||||
18,Black Acre Brewing Co.,Indianapolis, IN
|
||||
19,Brew Link Brewing,Plainfield, IN
|
||||
20,Bare Hands Brewery,Granger, IN
|
||||
21,Three Pints Brewing,Martinsville, IN
|
||||
22,Four Fathers Brewing ,Valparaiso, IN
|
||||
23,Indiana City Brewing,Indianapolis, IN
|
||||
24,Burn 'Em Brewing,Michigan City, IN
|
||||
25,Sun King Brewing Company,Indianapolis, IN
|
||||
26,Evil Czech Brewery,Mishawaka, IN
|
||||
27,450 North Brewing Company,Columbus, IN
|
||||
28,Taxman Brewing Company,Bargersville, IN
|
||||
29,Cedar Creek Brewery,Seven Points, TX
|
||||
30,SanTan Brewing Company,Chandler, AZ
|
||||
31,Boulevard Brewing Company,Kansas City, MO
|
||||
32,James Page Brewing Company,Stevens Point, WI
|
||||
33,The Dudes' Brewing Company,Torrance, CA
|
||||
34,Ballast Point Brewing Company,San Diego, CA
|
||||
35,Anchor Brewing Company,San Francisco, CA
|
||||
36,Figueroa Mountain Brewing Company,Buellton, CA
|
||||
37,Avery Brewing Company,Boulder, CO
|
||||
38,Twisted X Brewing Company,Dripping Springs, TX
|
||||
39,Gonzo's BiggDogg Brewing,Kalamazoo, MI
|
||||
40,Big Muddy Brewing,Murphysboro, IL
|
||||
41,Lost Nation Brewing,East Fairfield, VT
|
||||
42,Rising Tide Brewing Company,Portland, ME
|
||||
43,Rivertowne Brewing Company,Export, PA
|
||||
44,Revolution Brewing Company,Chicago, IL
|
||||
45,Tallgrass Brewing Company,Manhattan, KS
|
||||
46,Sixpoint Craft Ales,Brooklyn, NY
|
||||
47,White Birch Brewing,Hooksett, NH
|
||||
48,Firestone Walker Brewing Company,Paso Robles, CA
|
||||
49,SweetWater Brewing Company,Atlanta, GA
|
||||
50,Flying Mouse Brewery,Troutville, VA
|
||||
51,Upslope Brewing Company,Boulder, CO
|
||||
52,Pipeworks Brewing Company,Chicago, IL
|
||||
53,Bent Brewstillery,Roseville, MN
|
||||
54,Flesk Brewing Company,Lombard, IL
|
||||
55,Pollyanna Brewing Company,Lemont, IL
|
||||
56,BuckleDown Brewing,Lyons, IL
|
||||
57,Destihl Brewery,Bloomington, IL
|
||||
58,Summit Brewing Company,St. Paul, MN
|
||||
59,Latitude 42 Brewing Company,Portage, MI
|
||||
60,4 Hands Brewing Company,Saint Louis, MO
|
||||
61,Surly Brewing Company,Brooklyn Center, MN
|
||||
62,Against The Grain Brewery,Louisville, KY
|
||||
63,Crazy Mountain Brewing Company,Edwards, CO
|
||||
64,SlapShot Brewing Company,Chicago, IL
|
||||
65,Mikerphone Brewing,Chicago, IL
|
||||
66,Freetail Brewing Company,San Antonio, TX
|
||||
67,3 Daughters Brewing,St Petersburg, FL
|
||||
68,Red Shedman Farm Brewery and Hop...,Mt. Airy, MD
|
||||
69,Appalachian Mountain Brewery,Boone, NC
|
||||
70,Birdsong Brewing Company,Charlotte, NC
|
||||
71,Union Craft Brewing,Baltimore, MD
|
||||
72,Atwater Brewery,Detroit, MI
|
||||
73,Ale Asylum,Madison, WI
|
||||
74,Two Brothers Brewing Company,Warrenville, IL
|
||||
75,Bent Paddle Brewing Company,Duluth, MN
|
||||
76,Bell's Brewery,Kalamazoo, MI
|
||||
77,Blue Owl Brewing,Austin, TX
|
||||
78,Speakasy Ales & Lagers,San Francisco, CA
|
||||
79,Black Tooth Brewing Company,Sheridan, WY
|
||||
80,Hopworks Urban Brewery,Portland, OR
|
||||
81,Epic Brewing,Denver, CO
|
||||
82,New Belgium Brewing Company,Fort Collins, CO
|
||||
83,Sierra Nevada Brewing Company,Chico, CA
|
||||
84,Keweenaw Brewing Company,Houghton, MI
|
||||
85,Brewery Terra Firma,Traverse City, MI
|
||||
86,Grey Sail Brewing Company,Westerly, RI
|
||||
87,Kirkwood Station Brewing Company,Kirkwood, MO
|
||||
88,Goose Island Brewing Company,Chicago, IL
|
||||
89,Broad Brook Brewing LLC,East Windsor, CT
|
||||
90,The Lion Brewery,Wilkes-Barre, PA
|
||||
91,Madtree Brewing Company,Cincinnati, OH
|
||||
92,Jackie O's Pub & Brewery,Athens, OH
|
||||
93,Rhinegeist Brewery,Cincinnati, OH
|
||||
94,Warped Wing Brewing Company,Dayton, OH
|
||||
95,Blackrocks Brewery,Marquette, MA
|
||||
96,Catawba Valley Brewing Company,Morganton, NC
|
||||
97,Tröegs Brewing Company,Hershey, PA
|
||||
98,Mission Brewery,San Diego, CA
|
||||
99,Christian Moerlein Brewing Company,Cincinnati, OH
|
||||
100,West Sixth Brewing,Lexington, KY
|
||||
101,Coastal Extreme Brewing Company,Newport, RI
|
||||
102,King Street Brewing Company,Anchorage, AK
|
||||
103,Beer Works Brewery,Lowell, MA
|
||||
104,Lone Tree Brewing Company,Lone Tree, CO
|
||||
105,Four String Brewing Company,Columbus, OH
|
||||
106,Glabrous Brewing Company,Pineland, ME
|
||||
107,Bonfire Brewing Company,Eagle, CO
|
||||
108,Thomas Hooker Brewing Company,Bloomfield, CT
|
||||
109,"Woodstock Inn, Station & Brewery",North Woodstock, NH
|
||||
110,Renegade Brewing Company,Denver, CO
|
||||
111,Mother Earth Brew Company,Vista, CA
|
||||
112,Black Market Brewing Company,Temecula, CA
|
||||
113,Vault Brewing Company,Yardley, PA
|
||||
114,Jailbreak Brewing Company,Laurel, MD
|
||||
115,Smartmouth Brewing Company,Norfolk, VA
|
||||
116,Base Camp Brewing Co.,Portland, OR
|
||||
117,Alameda Brewing,Portland, OR
|
||||
118,Southern Star Brewing Company,Conroe, TX
|
||||
119,Steamworks Brewing Company,Durango, CO
|
||||
120,Horny Goat Brew Pub,Milwaukee, WI
|
||||
121,Cheboygan Brewing Company,Cheboygan, MI
|
||||
122,Center of the Universe Brewing C...,Ashland, VA
|
||||
123,Ipswich Ale Brewery,Ipswich, MA
|
||||
124,Griffin Claw Brewing Company,Birmingham, MI
|
||||
125,Karbach Brewing Company,Houston, TX
|
||||
126,Uncle Billy's Brewery and Smokeh...,Austin, TX
|
||||
127,Deep Ellum Brewing Company,Dallas, TX
|
||||
128,Real Ale Brewing Company,Blanco, TX
|
||||
129,Straub Brewery,St Mary's, PA
|
||||
130,Shebeen Brewing Company,Wolcott, CT
|
||||
131,Stevens Point Brewery,Stevens Point, WI
|
||||
132,Weston Brewing Company,Weston, MO
|
||||
133,Southern Prohibition Brewing Com...,Hattiesburg, MS
|
||||
134,Minhas Craft Brewery,Monroe, WI
|
||||
135,Pug Ryan's Brewery,Dillon, CO
|
||||
136,Hops & Grains Brewing Company,Austin, TX
|
||||
137,Sietsema Orchards and Cider Mill,Ada, MI
|
||||
138,Summit Brewing Company,St Paul, MN
|
||||
139,Core Brewing & Distilling Company,Springdale, AR
|
||||
140,Independence Brewing Company,Austin, TX
|
||||
141,Cigar City Brewing Company,Tampa, FL
|
||||
142,Third Street Brewhouse,Cold Spring, MN
|
||||
143,Narragansett Brewing Company,Providence, RI
|
||||
144,Grimm Brothers Brewhouse,Loveland, CO
|
||||
145,Cisco Brewers,Nantucket, MA
|
||||
146,Angry Minnow,Hayward, WI
|
||||
147,Platform Beer Company,Cleveland, OH
|
||||
148,Odyssey Beerwerks,Arvada, CO
|
||||
149,Lonerider Brewing Company,Raleigh, NC
|
||||
150,Oakshire Brewing,Eugene, OR
|
||||
151,Fort Pitt Brewing Company,Latrobe, PA
|
||||
152,Tin Roof Brewing Company,Baton Rouge, LA
|
||||
153,Three Creeks Brewing,Sisters, OR
|
||||
154,2 Towns Ciderhouse,Corvallis, OR
|
||||
155,Caldera Brewing Company,Ashland, OR
|
||||
156,Greenbrier Valley Brewing Company,Lewisburg, WV
|
||||
157,Phoenix Ale Brewery,Phoenix, AZ
|
||||
158,Lumberyard Brewing Company,Flagstaff, AZ
|
||||
159,Uinta Brewing Company,Salt Lake City, UT
|
||||
160,Four Peaks Brewing Company,Tempe, AZ
|
||||
161,Martin House Brewing Company,Fort Worth, TX
|
||||
162,Right Brain Brewery,Traverse City, MI
|
||||
163,Sly Fox Brewing Company,Phoenixville, PA
|
||||
164,Round Guys Brewing,Lansdale, PA
|
||||
165,Great Crescent Brewery,Aurora, IN
|
||||
166,Oskar Blues Brewery,Longmont, CO
|
||||
167,Boxcar Brewing Company,West Chester, PA
|
||||
168,High Hops Brewery,Windsor, CO
|
||||
169,Crooked Fence Brewing Company,Garden City, ID
|
||||
170,Everybody's Brewing,White Salmon, WA
|
||||
171,Anderson Valley Brewing Company,Boonville, CA
|
||||
172,Fiddlehead Brewing Company,Shelburne, VT
|
||||
173,Evil Twin Brewing,Brooklyn, NY
|
||||
174,New Orleans Lager & Ale Brewing ...,New Orleans, LA
|
||||
175,Spiteful Brewing Company,Chicago, IL
|
||||
176,Rahr & Sons Brewing Company,Fort Worth, TX
|
||||
177,18th Street Brewery,Gary, IN
|
||||
178,Cambridge Brewing Company,Cambridge, MA
|
||||
179,Carolina Brewery,Pittsboro, NC
|
||||
180,Frog Level Brewing Company,Waynesville, NC
|
||||
181,Wild Wolf Brewing Company,Nellysford, VA
|
||||
182,COOP Ale Works,Oklahoma City, OK
|
||||
183,Seventh Son Brewing Company,Columbus, OH
|
||||
184,Oasis Texas Brewing Company,Austin, TX
|
||||
185,Vander Mill Ciders,Spring Lake, MI
|
||||
186,St. Julian Winery,Paw Paw, MI
|
||||
187,Pedernales Brewing Company,Fredericksburg, TX
|
||||
188,Mother's Brewing,Springfield, MO
|
||||
189,Modern Monks Brewery,Lincoln, NE
|
||||
190,Two Beers Brewing Company,Seattle, WA
|
||||
191,Snake River Brewing Company,Jackson, WY
|
||||
192,Capital Brewery,Middleton, WI
|
||||
193,Anthem Brewing Company,Oklahoma City, OK
|
||||
194,Goodlife Brewing Co.,Bend, OR
|
||||
195,Breakside Brewery,Portland, OR
|
||||
196,Goose Island Brewery Company,Chicago, IL
|
||||
197,Burnside Brewing Co.,Portland, OR
|
||||
198,Hop Valley Brewing Company,Springfield, OR
|
||||
199,Worthy Brewing Company,Bend, OR
|
||||
200,Occidental Brewing Company,Portland, OR
|
||||
201,Fearless Brewing Company,Estacada, OR
|
||||
202,Upland Brewing Company,Bloomington, IN
|
||||
203,Mehana Brewing Co.,Hilo, HI
|
||||
204,Hawai'i Nui Brewing Co.,Hilo, HI
|
||||
205,People's Brewing Company,Lafayette, IN
|
||||
206,Fort George Brewery,Astoria, OR
|
||||
207,Branchline Brewing Company,San Antonio, TX
|
||||
208,Kalona Brewing Company,Kalona, IA
|
||||
209,Modern Times Beer,San Diego, CA
|
||||
210,Temperance Beer Company,Evanston, IL
|
||||
211,Wisconsin Brewing Company,Verona, WI
|
||||
212,Crow Peak Brewing Company,Spearfish, SD
|
||||
213,Grapevine Craft Brewery,Farmers Branch, TX
|
||||
214,Buffalo Bayou Brewing Company,Houston, TX
|
||||
215,Texian Brewing Co.,Richmond, TX
|
||||
216,Orpheus Brewing,Atlanta, GA
|
||||
217,Forgotten Boardwalk,Cherry Hill, NJ
|
||||
218,Laughing Dog Brewing Company,Ponderay, ID
|
||||
219,Bozeman Brewing Company,Bozeman, MT
|
||||
220,Big Choice Brewing,Broomfield, CO
|
||||
221,Big Storm Brewing Company,Odessa, FL
|
||||
222,Carton Brewing Company,Atlantic Highlands, NJ
|
||||
223,Midnight Sun Brewing Company,Anchorage, AK
|
||||
224,Fat Head's Brewery,Middleburg Heights, OH
|
||||
225,Refuge Brewery,Temecula, CA
|
||||
226,Chatham Brewing,Chatham, NY
|
||||
227,DC Brau Brewing Company,Washington, DC
|
||||
228,Geneva Lake Brewing Company,Lake Geneva, WI
|
||||
229,Rochester Mills Brewing Company,Rochester, MI
|
||||
230,Cape Ann Brewing Company,Gloucester, MA
|
||||
231,Borderlands Brewing Company,Tucson, AZ
|
||||
232,College Street Brewhouse and Pub,Lake Havasu City, AZ
|
||||
233,Joseph James Brewing Company,Henderson, NV
|
||||
234,Harpoon Brewery,Boston, MA
|
||||
235,Back East Brewing Company,Bloomfield, CT
|
||||
236,Champion Brewing Company,Charlottesville, VA
|
||||
237,Devil's Backbone Brewing Company,Lexington, VA
|
||||
238,Newburgh Brewing Company,Newburgh, NY
|
||||
239,Wiseacre Brewing Company,Memphis, TN
|
||||
240,Golden Road Brewing,Los Angeles, CA
|
||||
241,New Republic Brewing Company,College Station, TX
|
||||
242,Infamous Brewing Company,Austin, TX
|
||||
243,Two Henrys Brewing Company,Plant City, FL
|
||||
244,Lift Bridge Brewing Company,Stillwater, MN
|
||||
245,Lucky Town Brewing Company,Jackson, MS
|
||||
246,Quest Brewing Company,Greenville, SC
|
||||
247,Creature Comforts,Athens, GA
|
||||
248,Half Full Brewery,Stamford, CT
|
||||
249,Southampton Publick House,Southampton, NY
|
||||
250,Chapman's Brewing,Angola, IN
|
||||
251,Barrio Brewing Company,Tucson, AZ
|
||||
252,Santa Cruz Mountain Brewing,Santa Cruz, CA
|
||||
253,Frankenmuth Brewery,Frankenmuth, MI
|
||||
254,Meckley's Cidery,Somerset Center, MI
|
||||
255,Stillwater Artisanal Ales,Baltimore, MD
|
||||
256,Finch's Beer Company,Chicago, IL
|
||||
257,South Austin Brewery,South Austin, TX
|
||||
258,Bauhaus Brew Labs,Minneapolis, MN
|
||||
259,Ozark Beer Company,Rogers, AR
|
||||
260,Mountain Town Brewing Company ,Mount Pleasant, MI
|
||||
261,Otter Creek Brewing,Waterbury, VT
|
||||
262,The Brewer's Art,Baltimore, MD
|
||||
263,Denver Beer Company,Denver, CO
|
||||
264,Ska Brewing Company,Durango, CO
|
||||
265,Tractor Brewing Company,Albuquerque, NM
|
||||
266,Peak Organic Brewing Company,Portland, ME
|
||||
267,Cape Cod Beer,Hyannis, MA
|
||||
268,Long Trail Brewing Company,Bridgewater Corners, VT
|
||||
269,Great Raft Brewing Company,Shreveport, LA
|
||||
270,Alaskan Brewing Company,Juneau, AK
|
||||
271,Notch Brewing Company,Ipswich, MA
|
||||
272,The Alchemist,Waterbury, VT
|
||||
273,Three Notch'd Brewing Company,Charlottesville, VA
|
||||
274,Portside Brewery,Cleveland, OH
|
||||
275,Otter Creek Brewing,Middlebury, VT
|
||||
276,Montauk Brewing Company,Montauk, NY
|
||||
277,Indeed Brewing Company,Minneapolis, MN
|
||||
278,Berkshire Brewing Company,South Deerfield, MA
|
||||
279,Foolproof Brewing Company,Pawtucket, RI
|
||||
280,Headlands Brewing Company,Mill Valley, CA
|
||||
281,Bolero Snort Brewery,Ridgefield Park, NJ
|
||||
282,Thunderhead Brewing Company,Kearney, NE
|
||||
283,Defiance Brewing Company,Hays, KS
|
||||
284,Milwaukee Brewing Company,Milwaukee, WI
|
||||
285,Catawba Island Brewing,Port Clinton, OH
|
||||
286,Back Forty Beer Company,Gadsden, AL
|
||||
287,Four Corners Brewing Company,Dallas, TX
|
||||
288,Saint Archer Brewery,San Diego, CA
|
||||
289,Rogue Ales,Newport, OR
|
||||
290,Hale's Ales,Seattle, WA
|
||||
291,Tommyknocker Brewery,Idaho Springs, CO
|
||||
292,Baxter Brewing Company,Lewiston, ME
|
||||
293,Northampton Brewery,Northamtpon, MA
|
||||
294,Black Shirt Brewing Company,Denver, CO
|
||||
295,Wachusett Brewing Company,Westminster, MA
|
||||
296,Widmer Brothers Brewing Company,Portland, OR
|
||||
297,Hop Farm Brewing Company,Pittsburgh, PA
|
||||
298,Liquid Hero Brewery,York, PA
|
||||
299,Matt Brewing Company,Utica, NY
|
||||
300,Boston Beer Company,Boston, MA
|
||||
301,Old Forge Brewing Company,Danville, PA
|
||||
302,Utah Brewers Cooperative,Salt Lake City, UT
|
||||
303,Magic Hat Brewing Company,South Burlington, VT
|
||||
304,Blue Hills Brewery,Canton, MA
|
||||
305,Night Shift Brewing,Everett, MA
|
||||
306,Beach Brewing Company,Virginia Beach, VA
|
||||
307,Payette Brewing Company,Garden City, ID
|
||||
308,Brew Bus Brewing,Tampa, FL
|
||||
309,Sockeye Brewing Company,Boise, ID
|
||||
310,Pine Street Brewery,San Francisco, CA
|
||||
311,Dirty Bucket Brewing Company,Woodinville, WA
|
||||
312,Jackalope Brewing Company,Nashville, TN
|
||||
313,Slanted Rock Brewing Company,Meridian, ID
|
||||
314,Piney River Brewing Company,Bucryus, MO
|
||||
315,Cutters Brewing Company,Avon, IN
|
||||
316,Iron Hill Brewery & Restaurant,Wilmington, DE
|
||||
317,Marshall Wharf Brewing Company,Belfast, ME
|
||||
318,Banner Beer Company,Williamsburg, MA
|
||||
319,Dick's Brewing Company,Centralia, WA
|
||||
320,Claremont Craft Ales,Claremont, CA
|
||||
321,Rivertown Brewing Company,Lockland, OH
|
||||
322,Voodoo Brewery,Meadville, PA
|
||||
323,D.L. Geary Brewing Company,Portland, ME
|
||||
324,Pisgah Brewing Company,Black Mountain, NC
|
||||
325,Neshaminy Creek Brewing Company,Croydon, PA
|
||||
326,Morgan Street Brewery,Saint Louis, MO
|
||||
327,Half Acre Beer Company,Chicago, IL
|
||||
328,The Just Beer Project,Burlington, VT
|
||||
329,The Bronx Brewery,Bronx, NY
|
||||
330,Dead Armadillo Craft Brewing,Tulsa, OK
|
||||
331,Catawba Brewing Company,Morganton, NC
|
||||
332,La Cumbre Brewing Company,Albuquerque, NM
|
||||
333,David's Ale Works,Diamond Springs, CA
|
||||
334,The Traveler Beer Company,Burlington, VT
|
||||
335,Fargo Brewing Company,Fargo, ND
|
||||
336,Big Sky Brewing Company,Missoula, MT
|
||||
337,Nebraska Brewing Company,Papillion, NE
|
||||
338,Uncle John's Fruit House Winery,St. John's, MI
|
||||
339,Wormtown Brewery,Worcester, MA
|
||||
340,Due South Brewing Company,Boynton Beach, FL
|
||||
341,Palisade Brewing Company,Palisade, CO
|
||||
342,KelSo Beer Company,Brooklyn, NY
|
||||
343,Hardywood Park Craft Brewery,Richmond, VA
|
||||
344,Wolf Hills Brewing Company,Abingdon, VA
|
||||
345,Lavery Brewing Company,Erie, PA
|
||||
346,Manzanita Brewing Company,Santee, CA
|
||||
347,Fullsteam Brewery,Durham, NC
|
||||
348,Four Horsemen Brewing Company,South Bend, IN
|
||||
349,Hinterland Brewery,Green Bay, WI
|
||||
350,Central Coast Brewing Company,San Luis Obispo, CA
|
||||
351,Westfield River Brewing Company,Westfield, MA
|
||||
352,Elevator Brewing Company,Columbus, OH
|
||||
353,Aslan Brewing Company,Bellingham, WA
|
||||
354,Kulshan Brewery,Bellingham, WA
|
||||
355,Pikes Peak Brewing Company,Monument, CO
|
||||
356,Manayunk Brewing Company,Philadelphia, PA
|
||||
357,Buckeye Brewing,Cleveland, OH
|
||||
358,Daredevil Brewing Company,Shelbyville, IN
|
||||
359,NoDa Brewing Company,Charlotte, NC
|
||||
360,Aviator Brewing Company,Fuquay-Varina, NC
|
||||
361,Wild Onion Brewing Company,Lake Barrington, IL
|
||||
362,Hilliard's Beer,Seattle, WA
|
||||
363,Mikkeller,Pottstown, PA
|
||||
364,Bohemian Brewery,Midvale, UT
|
||||
365,Great River Brewery,Davenport, IA
|
||||
366,Mustang Brewing Company,Mustang, OK
|
||||
367,Airways Brewing Company,Kent, WA
|
||||
368,21st Amendment Brewery,San Francisco, CA
|
||||
369,Eddyline Brewery & Restaurant,Buena Vista, CO
|
||||
370,Pizza Port Brewing Company,Carlsbad, CA
|
||||
371,Sly Fox Brewing Company,Pottstown, PA
|
||||
372,Spring House Brewing Company,Conestoga, PA
|
||||
373,7venth Sun,Dunedin, FL
|
||||
374,Astoria Brewing Company,Astoria, OR
|
||||
375,Maui Brewing Company,Lahaina, HI
|
||||
376,RoughTail Brewing Company,Midwest City, OK
|
||||
377,Lucette Brewing Company,Menominee, WI
|
||||
378,Bold City Brewery,Jacksonville, FL
|
||||
379,Grey Sail Brewing of Rhode Island,Westerly, RI
|
||||
380,Blue Blood Brewing Company,Lincoln, NE
|
||||
381,Swashbuckler Brewing Company,Manheim, PA
|
||||
382,Blue Mountain Brewery,Afton, VA
|
||||
383,Starr Hill Brewery,Crozet, VA
|
||||
384,Westbrook Brewing Company,Mt. Pleasant, SC
|
||||
385,Shipyard Brewing Company,Portland, ME
|
||||
386,Revolution Brewing,Paonia, CO
|
||||
387,Natian Brewery,Portland, OR
|
||||
388,Alltech's Lexington Brewing Company,Lexington, KY
|
||||
389,Oskar Blues Brewery (North Carol...,Brevard, NC
|
||||
390,Orlison Brewing Company,Airway Heights, WA
|
||||
391,Breckenridge Brewery,Denver, CO
|
||||
392,Santa Fe Brewing Company,Santa Fe, NM
|
||||
393,Miami Brewing Company,Miami, FL
|
||||
394,Schilling & Company,Seattle, WA
|
||||
395,Hops & Grain Brewery,Austin, TX
|
||||
396,White Flame Brewing Company,Hudsonville, MI
|
||||
397,Ruhstaller Beer Company,Sacramento, CA
|
||||
398,Saugatuck Brewing Company,Douglas, MI
|
||||
399,Moab Brewery,Moab, UT
|
||||
400,Macon Beer Company,Macon, GA
|
||||
401,Amnesia Brewing Company,Washougal, WA
|
||||
402,Wolverine State Brewing Company,Ann Arbor, MI
|
||||
403,Red Tank Cider Company,Bend, OR
|
||||
404,Cascadia Ciderworks United,Portland, OR
|
||||
405,Fate Brewing Company,Boulder, CO
|
||||
406,Lazy Monk Brewing,Eau Claire, WI
|
||||
407,Bitter Root Brewing,Hamilton, MT
|
||||
408,10 Barrel Brewing Company,Bend, OR
|
||||
409,Tamarack Brewing Company,Lakeside, MT
|
||||
410,New England Brewing Company,Woodbridge, CT
|
||||
411,Seattle Cider Company,Seattle, WA
|
||||
412,Straight to Ale,Huntsville, AL
|
||||
413,Austin Beerworks,Austin, TX
|
||||
414,Blue Mountain Brewery,Arrington, VA
|
||||
415,Coastal Empire Beer Company,Savannah, GA
|
||||
416,Jack's Hard Cider (Hauser Estate...,Biglerville, PA
|
||||
417,Boulder Beer Company,Boulder, CO
|
||||
418,Coalition Brewing Company,Portland, OR
|
||||
419,Sanitas Brewing Company,Boulder, CO
|
||||
420,Gore Range Brewery,Edwards, CO
|
||||
421,Redstone Meadery,Boulder, CO
|
||||
422,Blue Dog Mead,Eugene, OR
|
||||
423,Hess Brewing Company,San Diego, CA
|
||||
424,Wynkoop Brewing Company,Denver, CO
|
||||
425,Ciderboys,Stevens Point, WI
|
||||
426,Armadillo Ale Works,Denton, TX
|
||||
427,Roanoke Railhouse Brewery,Roanoke, VA
|
||||
428,Schlafly Brewing Company,Saint Louis, MO
|
||||
429,Asher Brewing Company,Boulder, CO
|
||||
430,Lost Rhino Brewing Company,Ashburn, VA
|
||||
431,North Country Brewing Company,Slippery Rock, PA
|
||||
432,Seabright Brewery,Santa Cruz, CA
|
||||
433,French Broad Brewery,Asheville, NC
|
||||
434,Angry Orchard Cider Company,Cincinnati, OH
|
||||
435,Two Roads Brewing Company,Stratford, CT
|
||||
436,Southern Oregon Brewing Company,Medford, OR
|
||||
437,Brooklyn Brewery,Brooklyn, NY
|
||||
438,The Right Brain Brewery,Traverse City, MI
|
||||
439,Kona Brewing Company,Kona, HI
|
||||
440,MillKing It Productions,Royal Oak, MI
|
||||
441,Pateros Creek Brewing Company,Fort Collins, CO
|
||||
442,O'Fallon Brewery,O'Fallon, MO
|
||||
443,Marble Brewery,Albuquerque, NM
|
||||
444,Big Wood Brewery,Vadnais Heights, MN
|
||||
445,Howard Brewing Company,Lenoir, NC
|
||||
446,Downeast Cider House,Leominster, MA
|
||||
447,Swamp Head Brewery,Gainesville, FL
|
||||
448,Mavericks Beer Company,Half Moon Bay, CA
|
||||
449,TailGate Beer,San Diego, CA
|
||||
450,Northwest Brewing Company,Pacific, WA
|
||||
451,Dad & Dude's Breweria,Aurora, CO
|
||||
452,Centennial Beer Company,Edwards, CO
|
||||
453,Denali Brewing Company,Talkeetna, AK
|
||||
454,Deschutes Brewery,Bend, OR
|
||||
455,Sunken City Brewing Company,Hardy, VA
|
||||
456,Lucette Brewing Company,Menominie, WI
|
||||
457,The Black Tooth Brewing Company,Sheridan, WY
|
||||
458,Kenai River Brewing Company,Soldotna, AK
|
||||
459,River North Brewery,Denver, CO
|
||||
460,Fremont Brewing Company,Seattle, WA
|
||||
461,Armstrong Brewing Company,South San Francisco, CA
|
||||
462,AC Golden Brewing Company,Golden, CO
|
||||
463,Big Bend Brewing Company,Alpine, TX
|
||||
464,Good Life Brewing Company,Bend, OR
|
||||
465,Engine 15 Brewing,Jacksonville Beach, FL
|
||||
466,Green Room Brewing,Jacksonville, FL
|
||||
467,Brindle Dog Brewing Company,Tampa Bay, FL
|
||||
468,Peace Tree Brewing Company,Knoxville, IA
|
||||
469,Terrapin Brewing Company,Athens, GA
|
||||
470,Pete's Brewing Company,San Antonio, TX
|
||||
471,Okoboji Brewing Company,Spirit Lake, IA
|
||||
472,Crystal Springs Brewing Company,Boulder, CO
|
||||
473,Engine House 9,Tacoma, WA
|
||||
474,Tonka Beer Company,Minnetonka, MN
|
||||
475,Red Hare Brewing Company,Marietta, GA
|
||||
476,Hangar 24 Craft Brewery,Redlands, CA
|
||||
477,Big Elm Brewing,Sheffield, MA
|
||||
478,Good People Brewing Company,Birmingham, AL
|
||||
479,Heavy Seas Beer,Halethorpe, MD
|
||||
480,Telluride Brewing Company,Telluride, CO
|
||||
481,7 Seas Brewing Company,Gig Harbor, WA
|
||||
482,Confluence Brewing Company,Des Moines, IA
|
||||
483,Bale Breaker Brewing Company,Yakima, WA
|
||||
484,The Manhattan Brewing Company,New York, NY
|
||||
485,MacTarnahans Brewing Company,Portland, OR
|
||||
486,Stillmank Beer Company,Green Bay, WI
|
||||
487,Redhook Brewery,Woodinville, WA
|
||||
488,Dock Street Brewery,Philadelphia, PA
|
||||
489,Blue Point Brewing Company,Patchogue, NY
|
||||
490,Tampa Bay Brewing Company,Tampa, FL
|
||||
491,Devil's Canyon Brewery,Belmont, CA
|
||||
492,Stone Coast Brewing Company,Portland, ME
|
||||
493,Broken Tooth Brewing Company,Anchorage, AK
|
||||
494,Seven Brides Brewery,Silverton, OR
|
||||
495,Newburyport Brewing Company,Newburyport, MA
|
||||
496,Dry Dock Brewing Company,Aurora, CO
|
||||
497,Cans Bar and Canteen,Charlotte, NC
|
||||
498,Sprecher Brewing Company,Glendale, WI
|
||||
499,Wildwood Brewing Company,Stevensville, MT
|
||||
500,High Noon Saloon And Brewery,Leavenworth, KS
|
||||
501,Woodchuck Hard Cider,Middlebury, VT
|
||||
502,Sea Dog Brewing Company,Portland, ME
|
||||
503,Oskar Blues Brewery,Lyons, CO
|
||||
504,Carolina Beer & Beverage,Mooresville, NC
|
||||
505,Krebs Brewing Company (Pete's Pl...,Krebs, OK
|
||||
506,Warbird Brewing Company,Fort Wayne, IN
|
||||
507,Mudshark Brewing Company,Lake Havasu City, AZ
|
||||
508,Spilker Ales,Cortland, NE
|
||||
509,Wingman Brewers,Tacoma, WA
|
||||
510,Kettle House Brewing Company,Missoula, MT
|
||||
511,Sherwood Forest Brewers,Marlborough, MA
|
||||
512,Cottrell Brewing,Pawcatuck, CT
|
||||
513,Arctic Craft Brewery,Colorado Springs, CO
|
||||
514,Monkey Paw Pub & Brewery,San Diego, CA
|
||||
515,Crabtree Brewing Company,Greeley, CO
|
||||
516,Emerald City Beer Company,Seattle, WA
|
||||
517,Butcher's Brewing,Carlsbad, CA
|
||||
518,New South Brewing Company,Myrtle Beach, SC
|
||||
519,Big River Brewing Company,Chattanooga, TN
|
||||
520,Twisted Pine Brewing Company,Boulder, CO
|
||||
521,Flying Dog Brewery,Frederick, MD
|
||||
522,Uncommon Brewers,Santa Cruz, CA
|
||||
523,Aspen Brewing Company,Aspen, CO
|
||||
524,Triangle Brewing Company,Durham, NC
|
||||
525,Bomb Beer Company,New York, NY
|
||||
526,Churchkey Can Company,Seattle, WA
|
||||
527,Intuition Ale Works,Jacksonville, FL
|
||||
528,Asheville Brewing Company,Asheville, NC
|
||||
529,Northwoods Brewpub,Eau Claire, WI
|
||||
530,Buckbean Brewing Company,Reno, NV
|
||||
531,Dolores River Brewery,Dolores, CO
|
||||
532,Flat Rock Brewing Company,Smithton, PA
|
||||
533,Abita Brewing Company,Abita Springs, LA
|
||||
534,Mammoth Brewing Company,Mammoth Lakes, CA
|
||||
535,Harvest Moon Brewing Company,Belt, MT
|
||||
536,Grand Canyon Brewing Company,Williams, AZ
|
||||
537,Lewis and Clark Brewing Company,Helena, MT
|
||||
538,Dundee Brewing Company,Rochester, NY
|
||||
539,Twin Lakes Brewing Company,Greenville, DE
|
||||
540,Mother Earth Brewing Company,Kinston, NC
|
||||
541,Arcadia Brewing Company,Battle Creek, MI
|
||||
542,Angry Minnow Brewing Company,Hayward, WI
|
||||
543,Great Northern Brewing Company,Whitefish, MT
|
||||
544,Pyramid Breweries,Seattle, WA
|
||||
545,Lancaster Brewing Company,Lancaster, PA
|
||||
546,Upstate Brewing Company,Elmira, NY
|
||||
547,Moat Mountain Smoke House & Brew...,North Conway, NH
|
||||
548,Prescott Brewing Company,Prescott, AZ
|
||||
549,Mogollon Brewing Company,Flagstaff, AZ
|
||||
550,Wind River Brewing Company,Pinedale, WY
|
||||
551,Silverton Brewery,Silverton, CO
|
||||
552,Mickey Finn's Brewery,Libertyville, IL
|
||||
553,Covington Brewhouse,Covington, LA
|
||||
554,Dave's Brewfarm,Wilson, WI
|
||||
555,Ukiah Brewing Company,Ukiah, CA
|
||||
556,Butternuts Beer and Ale,Garrattsville, NY
|
||||
557,Sleeping Lady Brewing Company,Anchorage, AK
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,578 +0,0 @@
|
||||
[
|
||||
{
|
||||
"text": "100 Acre Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/100-acre-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "All My Friends Beer Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/all-my-friends-beer-co/"
|
||||
},
|
||||
{
|
||||
"text": "All or Nothing Brewhouse",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/all-or-nothing-brewhouse/"
|
||||
},
|
||||
{
|
||||
"text": "Anderson Craft Ales",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/anderson-craft-ales/"
|
||||
},
|
||||
{
|
||||
"text": "Badlands Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/badlands-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Bancroft Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/bancroft-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Banded Goose Brewing Comany",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/banded-goose-brewing-comany/"
|
||||
},
|
||||
{
|
||||
"text": "Beau’s Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/beaus-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "BeerLab! London",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/beerlab-london/"
|
||||
},
|
||||
{
|
||||
"text": "Bellwoods Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/bellwoods-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Bench Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/bench-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Beyond The Pale Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/beyond-the-pale-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Bicycle Craft Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/bicycle-craft-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Big Rig Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/big-rig-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Big Rock Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/big-rock-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Black Gold Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/black-gold-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Black Oak Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/black-oak-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Block 3 Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/block-3-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Blood Brothers Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/blood-brothers-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Bobcaygeon Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/bobcaygeon-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Boshkung Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/boshkung-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Brauwerk Hoffman – Rockland",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/brauwerk-hoffman-rockland/"
|
||||
},
|
||||
{
|
||||
"text": "Bridge Masters Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/bridge-masters-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Broadhead Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/broadhead-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Broken Rail Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/broken-rail-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Burdock Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/burdock-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "C’est What Durham Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/cest-what-durham-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Calabogie Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/calabogie-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Cameron’s Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/camerons-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Canvas Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/canvas-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Caps Off Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/caps-off-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Century Barn Brewing & Beverage Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/century-barn-brewing-and-beverage-company/"
|
||||
},
|
||||
{
|
||||
"text": "Chronicle Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/chronicle-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Clifford Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/clifford-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Cold Bear Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/cold-bear-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Collective Arts Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/collective-arts-brewing-ltd/"
|
||||
},
|
||||
{
|
||||
"text": "Common Good Beer Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/common-good-beer-co/"
|
||||
},
|
||||
{
|
||||
"text": "Couchiching Craft Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/couchiching-craft-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Cowbell Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/cowbell-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Cured Craft Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/cured-craft-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Daft Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/daft-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Dog House Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/dog-house-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Dominion City Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/dominion-city-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Eastbound Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/eastbound-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Equals Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/equals-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Fairweather Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/fairweather-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Farm League Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/farm-league-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Fixed Gear Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/fixed-gear-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Flying Monkeys Craft Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/flying-monkeys-craft-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Focal Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/focal-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Foundry Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/foundry-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Four Fathers Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/four-fathers-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Frank Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/frank-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Freddy’s",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/freddys/"
|
||||
},
|
||||
{
|
||||
"text": "Full Beard Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/1068-2/"
|
||||
},
|
||||
{
|
||||
"text": "Furnace Room Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/furnace-room-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Gateway City Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/gateway-city-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Glasstown Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/glasstown-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Godspeed Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/godspeed-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Goldenfield Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/goldenfield-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Grand River Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/grand-river-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Granite Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/granite-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Great Lakes Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/great-lakes-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Haliburton Highlands Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/haliburton-highlands-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Imperial City Brew House",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/imperial-city-brew-house/"
|
||||
},
|
||||
{
|
||||
"text": "Indie Ale House",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/indie-ale-house/"
|
||||
},
|
||||
{
|
||||
"text": "Jobsite Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/jobsite-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Kichesippi Beer Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/kichesippi-beer-co/"
|
||||
},
|
||||
{
|
||||
"text": "Kick and Push Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/kick-and-push-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Lake of Bays Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/lake-of-bays-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Lake Of The Woods Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/lake-of-the-woods-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Left Field Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/left-field-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Lightcaster Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/lightcaster-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "MacKinnon Brothers Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/mackinnon-brothers-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Maclean’s Ales Inc.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/macleans-ales-inc/"
|
||||
},
|
||||
{
|
||||
"text": "Magnotta Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/magnotta-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Market Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/market-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Mascot Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/mascot-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Matron Fine Beer",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/matron-fine-beer/"
|
||||
},
|
||||
{
|
||||
"text": "Meyers Creek Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/meyers-creek-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Midtown Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/midtown-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Miski Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/miski-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Muddy York Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/muddy-york-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Muskoka Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/muskoka-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Natterjack Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/natterjack-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Newark Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/newark-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Niagara Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/niagara-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Niagara College Teaching Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/niagara-college-teaching-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Niagara Oast House Brewers",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/niagara-oast-house-brewers/"
|
||||
},
|
||||
{
|
||||
"text": "Nickel Brook Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/nickel-brook-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Northern Superior Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/northern-superior-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Old Credit Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/old-credit-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Old Flame Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/1239-2/"
|
||||
},
|
||||
{
|
||||
"text": "Orléans Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/orleans-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Overflow Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/overflow-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Parsons Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/parsons-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Perth Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/perth-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Prince Eddy’s Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/prince-eddys-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Quayle’s Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/quayles-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Quetico Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/quetico-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Railway City Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/railway-city-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Ramblin’ Road Brewery Farm",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/ramblin-road-brewery-farm/"
|
||||
},
|
||||
{
|
||||
"text": "Red Barn Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/red-barn-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Refined Fool Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/refined-fool-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Rouge River Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/rouge-river-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Royal City Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/royal-city-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Sassy Britches Brewing Co Ltd",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/sassy-britches-brewing-co-ltd/"
|
||||
},
|
||||
{
|
||||
"text": "Sawdust City Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/sawdust-city-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Shawn & Ed Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/shawn-ed-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Silversmith Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/silversmith-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Slake Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/slake-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Sleeping Giant Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/sleeping-giant-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Something in the Water Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/something-in-the-water-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Sonnen Hill Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/sonnen-hill-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Sons of Kent Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/sons-of-kent-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Spark Beer",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/spark-beer/"
|
||||
},
|
||||
{
|
||||
"text": "Split Rail Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/split-rail-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Stack Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/stack-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Steam Whistle Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/steam-whistle-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Steel Wheel Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/steel-wheel-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Stonehooker Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/stonehooker-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Stonepicker Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/stonepicker-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Stray Dog Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/stray-dog-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "The Exchange Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/the-exchange-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "The Grove Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/the-grove-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "The Second Wedge Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/the-second-wedge-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Thornbury Village Craft Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/thornbury-village-craft-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Three Sheets Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/three-sheets-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Tooth and Nail Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/tooth-and-nail-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Torched Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/torched-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Town Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/town-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Trestle Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/trestle-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "True History Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/true-history-brewing/"
|
||||
},
|
||||
{
|
||||
"text": "Upper Thames Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/upper-thames-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Vimy Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/vimy-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Walkerville Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/walkerville-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Wave Maker Craft Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/wave-maker-craft-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Wellington Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/wellington-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Whiprsnapr Brewing Co.",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/whiprsnapr-brewing-co/"
|
||||
},
|
||||
{
|
||||
"text": "Whiskeyjack Beer Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/whiskeyjack-beer-company/"
|
||||
},
|
||||
{
|
||||
"text": "Whitewater Brewing Company",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/whitewater-brewing-company/"
|
||||
},
|
||||
{
|
||||
"text": "Willibald Farm Distillery & Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/willibald-farm-distillery-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Windmill Brewery",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/windmill-brewery/"
|
||||
},
|
||||
{
|
||||
"text": "Wishbone Brewing",
|
||||
"href": "https://ontariocraftbrewers.com/brewery-profile/wishbone-brewing/"
|
||||
}
|
||||
]
|
||||
36
DataLayer/scripts/crud/USP_CreateUserAccount.sql
Normal file
36
DataLayer/scripts/crud/USP_CreateUserAccount.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
CREATE OR ALTER PROCEDURE usp_CreateUserAccount
|
||||
(
|
||||
@UserAccountId UNIQUEIDENTIFIER = NULL,
|
||||
@Username VARCHAR(64),
|
||||
@FirstName NVARCHAR(128),
|
||||
@LastName NVARCHAR(128),
|
||||
@DateOfBirth DATETIME,
|
||||
@Email VARCHAR(128)
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SET XACT_ABORT ON
|
||||
BEGIN TRANSACTION
|
||||
|
||||
INSERT INTO UserAccount
|
||||
(
|
||||
UserAccountID,
|
||||
Username,
|
||||
FirstName,
|
||||
LastName,
|
||||
DateOfBirth,
|
||||
Email
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
COALESCE(@UserAccountId, NEWID()),
|
||||
@Username,
|
||||
@FirstName,
|
||||
@LastName,
|
||||
@DateOfBirth,
|
||||
@Email
|
||||
);
|
||||
COMMIT TRANSACTION
|
||||
END;
|
||||
23
DataLayer/scripts/crud/USP_DeleteUserAccount.sql
Normal file
23
DataLayer/scripts/crud/USP_DeleteUserAccount.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
CREATE OR ALTER PROCEDURE usp_DeleteUserAccount
|
||||
(
|
||||
@UserAccountId UNIQUEIDENTIFIER
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SET XACT_ABORT ON
|
||||
BEGIN TRANSACTION
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM UserAccount WHERE UserAccountId = @UserAccountId)
|
||||
BEGIN
|
||||
RAISERROR('UserAccount with the specified ID does not exist.', 16,
|
||||
1);
|
||||
ROLLBACK TRANSACTION
|
||||
RETURN
|
||||
END
|
||||
|
||||
DELETE FROM UserAccount
|
||||
WHERE UserAccountId = @UserAccountId;
|
||||
COMMIT TRANSACTION
|
||||
END;
|
||||
17
DataLayer/scripts/crud/USP_GetAllUserAccounts.sql
Normal file
17
DataLayer/scripts/crud/USP_GetAllUserAccounts.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
CREATE OR ALTER PROCEDURE usp_GetAllUserAccounts
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT UserAccountID,
|
||||
Username,
|
||||
FirstName,
|
||||
LastName,
|
||||
Email,
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
DateOfBirth,
|
||||
Timer
|
||||
FROM dbo.UserAccount;
|
||||
END;
|
||||
21
DataLayer/scripts/crud/USP_GetUserAccountByEmail.sql
Normal file
21
DataLayer/scripts/crud/USP_GetUserAccountByEmail.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
CREATE OR ALTER PROCEDURE usp_GetUserAccountByEmail
|
||||
(
|
||||
@Email VARCHAR(128)
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT UserAccountID,
|
||||
Username,
|
||||
FirstName,
|
||||
LastName,
|
||||
Email,
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
DateOfBirth,
|
||||
Timer
|
||||
FROM dbo.UserAccount
|
||||
WHERE Email = @Email;
|
||||
END;
|
||||
21
DataLayer/scripts/crud/USP_GetUserAccountById.sql
Normal file
21
DataLayer/scripts/crud/USP_GetUserAccountById.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
CREATE OR ALTER PROCEDURE usp_GetUserAccountById
|
||||
(
|
||||
@UserAccountId UNIQUEIDENTIFIER
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT UserAccountID,
|
||||
Username,
|
||||
FirstName,
|
||||
LastName,
|
||||
Email,
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
DateOfBirth,
|
||||
Timer
|
||||
FROM dbo.UserAccount
|
||||
WHERE UserAccountID = @UserAccountId;
|
||||
END;
|
||||
21
DataLayer/scripts/crud/USP_GetUserAccountByUsername.sql
Normal file
21
DataLayer/scripts/crud/USP_GetUserAccountByUsername.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
CREATE OR ALTER PROCEDURE usp_GetUserAccountByUsername
|
||||
(
|
||||
@Username VARCHAR(64)
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT UserAccountID,
|
||||
Username,
|
||||
FirstName,
|
||||
LastName,
|
||||
Email,
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
DateOfBirth,
|
||||
Timer
|
||||
FROM dbo.UserAccount
|
||||
WHERE Username = @Username;
|
||||
END;
|
||||
35
DataLayer/scripts/crud/USP_UpdateUserAccount.sql
Normal file
35
DataLayer/scripts/crud/USP_UpdateUserAccount.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
CREATE OR ALTER PROCEDURE usp_UpdateUserAccount
|
||||
(
|
||||
@Username VARCHAR(64),
|
||||
@FirstName NVARCHAR(128),
|
||||
@LastName NVARCHAR(128),
|
||||
@DateOfBirth DATETIME,
|
||||
@Email VARCHAR(128),
|
||||
@UserAccountId UNIQUEIDENTIFIER
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SET XACT_ABORT ON
|
||||
BEGIN TRANSACTION
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM UserAccount WHERE UserAccountId = @UserAccountId)
|
||||
BEGIN
|
||||
RAISERROR('UserAccount with the specified ID does not exist.', 16,
|
||||
1);
|
||||
ROLLBACK TRANSACTION
|
||||
RETURN
|
||||
END
|
||||
|
||||
UPDATE UserAccount
|
||||
SET
|
||||
Username = @Username,
|
||||
FirstName = @FirstName,
|
||||
LastName = @LastName,
|
||||
DateOfBirth = @DateOfBirth,
|
||||
Email = @Email
|
||||
WHERE UserAccountId = @UserAccountId;
|
||||
|
||||
COMMIT TRANSACTION
|
||||
END;
|
||||
@@ -1,26 +1,22 @@
|
||||
----------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------
|
||||
-- ----------------------------------------------------------------------------
|
||||
-- ----------------------------------------------------------------------------
|
||||
|
||||
USE master;
|
||||
-- USE master;
|
||||
|
||||
IF EXISTS (SELECT name
|
||||
FROM sys.databases
|
||||
WHERE name = N'Biergarten')
|
||||
BEGIN
|
||||
ALTER DATABASE Biergarten SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
|
||||
END
|
||||
GO
|
||||
-- IF EXISTS (SELECT name
|
||||
-- FROM sys.databases
|
||||
-- WHERE name = N'Biergarten')
|
||||
-- BEGIN
|
||||
-- ALTER DATABASE Biergarten SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
|
||||
-- END
|
||||
|
||||
DROP DATABASE IF EXISTS Biergarten;
|
||||
GO
|
||||
-- DROP DATABASE IF EXISTS Biergarten;
|
||||
|
||||
CREATE DATABASE Biergarten;
|
||||
GO
|
||||
-- CREATE DATABASE Biergarten;
|
||||
|
||||
USE Biergarten;
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------
|
||||
-- ----------------------------------------------------------------------------
|
||||
-- ----------------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE dbo.UserAccount
|
||||
(
|
||||
@@ -553,6 +549,3 @@ CREATE TABLE BeerPostComment
|
||||
CREATE NONCLUSTERED INDEX IX_BeerPostComment_BeerPost
|
||||
ON BeerPostComment(BeerPostID)
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------
|
||||
-- EOF
|
||||
@@ -1,6 +1,3 @@
|
||||
USE Biergarten;
|
||||
GO
|
||||
|
||||
CREATE OR ALTER FUNCTION dbo.UDF_GetCountryIdByCode
|
||||
(
|
||||
@CountryCode NVARCHAR(2)
|
||||
@@ -16,4 +13,3 @@ BEGIN
|
||||
|
||||
RETURN @CountryId;
|
||||
END;
|
||||
GO
|
||||
@@ -1,6 +1,3 @@
|
||||
USE Biergarten;
|
||||
GO
|
||||
|
||||
CREATE OR ALTER FUNCTION dbo.UDF_GetStateProvinceIdByCode
|
||||
(
|
||||
@StateProvinceCode NVARCHAR(6)
|
||||
@@ -14,4 +11,3 @@ BEGIN
|
||||
WHERE ISO3616_2 = @StateProvinceCode;
|
||||
RETURN @StateProvinceId;
|
||||
END;
|
||||
GO
|
||||
@@ -1,6 +1,3 @@
|
||||
USE Biergarten;
|
||||
GO
|
||||
|
||||
CREATE OR ALTER PROCEDURE dbo.USP_AddLocations
|
||||
AS
|
||||
BEGIN
|
||||
@@ -501,4 +498,3 @@ BEGIN
|
||||
|
||||
COMMIT TRANSACTION;
|
||||
END;
|
||||
GO
|
||||
@@ -1,6 +1,3 @@
|
||||
USE Biergarten;
|
||||
GO
|
||||
|
||||
CREATE OR ALTER PROCEDURE dbo.USP_AddTestUsers
|
||||
AS
|
||||
BEGIN
|
||||
@@ -133,4 +130,3 @@ BEGIN
|
||||
|
||||
COMMIT TRANSACTION;
|
||||
END;
|
||||
GO
|
||||
@@ -1,17 +1,5 @@
|
||||
USE Biergarten;
|
||||
GO
|
||||
|
||||
IF TYPE_ID(N'dbo.TblUserHashes') IS NULL
|
||||
EXEC('CREATE TYPE dbo.TblUserHashes AS TABLE
|
||||
(
|
||||
UserAccountId UNIQUEIDENTIFIER NOT NULL,
|
||||
Hash NVARCHAR(MAX) NOT NULL
|
||||
);');
|
||||
GO
|
||||
|
||||
-- Stored procedure to insert Argon2 hashes
|
||||
CREATE OR ALTER PROCEDURE dbo.USP_AddUserCredentials
|
||||
(
|
||||
(
|
||||
@Hash dbo.TblUserHashes READONLY
|
||||
)
|
||||
AS
|
||||
@@ -30,4 +18,3 @@ BEGIN
|
||||
|
||||
COMMIT TRANSACTION;
|
||||
END;
|
||||
GO
|
||||
@@ -1,6 +1,3 @@
|
||||
USE Biergarten;
|
||||
GO
|
||||
|
||||
CREATE OR ALTER PROCEDURE dbo.USP_CreateUserVerification
|
||||
AS
|
||||
BEGIN
|
||||
@@ -32,4 +29,3 @@ BEGIN
|
||||
|
||||
COMMIT TRANSACTION;
|
||||
END
|
||||
GO
|
||||
@@ -1,285 +0,0 @@
|
||||
using System.Data;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Konscious.Security.Cryptography;
|
||||
using Microsoft.Data.SqlClient;
|
||||
|
||||
|
||||
string ConnectionString = Environment.GetEnvironmentVariable(
|
||||
"DB_CONNECTION_STRING"
|
||||
)!;
|
||||
|
||||
static async Task BuildSchema(SqlConnection connection)
|
||||
{
|
||||
string sql = await File.ReadAllTextAsync(GetScriptPath("schema.sql"));
|
||||
await ExecuteScriptAsync(connection, sql);
|
||||
Console.WriteLine("Database schema created or updated successfully.");
|
||||
}
|
||||
|
||||
static async Task AddStoredProcsAndFunctions(SqlConnection connection)
|
||||
{
|
||||
string projectRoot = Path.GetFullPath(
|
||||
Path.Combine(AppContext.BaseDirectory, "..", "..", "..")
|
||||
);
|
||||
|
||||
string functionsDir = Path.Combine(projectRoot, "seed", "functions");
|
||||
string proceduresDir = Path.Combine(projectRoot, "seed", "procedures");
|
||||
string crudDir = Path.GetFullPath(
|
||||
Path.Combine(projectRoot, "..", "DataAccessLayer", "Sql", "crud")
|
||||
);
|
||||
|
||||
if (Directory.Exists(functionsDir))
|
||||
{
|
||||
foreach (
|
||||
string file in Directory
|
||||
.EnumerateFiles(
|
||||
functionsDir,
|
||||
"*.sql",
|
||||
SearchOption.TopDirectoryOnly
|
||||
)
|
||||
.OrderBy(f => f, StringComparer.OrdinalIgnoreCase)
|
||||
)
|
||||
{
|
||||
string sql = await File.ReadAllTextAsync(file);
|
||||
await ExecuteScriptAsync(connection, sql);
|
||||
Console.WriteLine(
|
||||
$"Executed function script: {Path.GetFileName(file)}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (Directory.Exists(proceduresDir))
|
||||
{
|
||||
foreach (
|
||||
string file in Directory
|
||||
.EnumerateFiles(
|
||||
proceduresDir,
|
||||
"*.sql",
|
||||
SearchOption.TopDirectoryOnly
|
||||
)
|
||||
.OrderBy(f => f, StringComparer.OrdinalIgnoreCase)
|
||||
)
|
||||
{
|
||||
string sql = await File.ReadAllTextAsync(file);
|
||||
await ExecuteScriptAsync(connection, sql);
|
||||
Console.WriteLine(
|
||||
$"Executed procedure script: {Path.GetFileName(file)}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (Directory.Exists(crudDir))
|
||||
{
|
||||
foreach (
|
||||
string file in Directory
|
||||
.EnumerateFiles(
|
||||
crudDir,
|
||||
"*.sql",
|
||||
SearchOption.TopDirectoryOnly
|
||||
)
|
||||
.OrderBy(f => f, StringComparer.OrdinalIgnoreCase)
|
||||
)
|
||||
{
|
||||
string sql = await File.ReadAllTextAsync(file);
|
||||
await ExecuteScriptAsync(connection, sql);
|
||||
Console.WriteLine(
|
||||
$"Executed CRUD script: {Path.GetFileName(file)}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine(
|
||||
"Functions and stored procedures added or updated successfully."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
static async Task RunSeedAsync(SqlConnection connection)
|
||||
{
|
||||
await ExecuteStoredProcedureAsync(connection, "dbo.USP_AddTestUsers");
|
||||
Console.WriteLine("Inserted or refreshed test users.");
|
||||
|
||||
DataTable credentialRows = await BuildCredentialTableAsync(connection);
|
||||
if (credentialRows.Rows.Count > 0)
|
||||
{
|
||||
await ExecuteCredentialProcedureAsync(connection, credentialRows);
|
||||
Console.WriteLine(
|
||||
$"Generated {credentialRows.Rows.Count} credential hashes."
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("No new credentials required.");
|
||||
}
|
||||
|
||||
await ExecuteStoredProcedureAsync(
|
||||
connection,
|
||||
"dbo.USP_CreateUserVerification"
|
||||
);
|
||||
Console.WriteLine("Ensured verification rows exist for all users.");
|
||||
}
|
||||
|
||||
static async Task ExecuteStoredProcedureAsync(
|
||||
SqlConnection connection,
|
||||
string storedProcedureName
|
||||
)
|
||||
{
|
||||
await using SqlCommand command = new SqlCommand(
|
||||
storedProcedureName,
|
||||
connection
|
||||
);
|
||||
command.CommandType = CommandType.StoredProcedure;
|
||||
await command.ExecuteNonQueryAsync();
|
||||
}
|
||||
|
||||
static async Task ExecuteCredentialProcedureAsync(
|
||||
SqlConnection connection,
|
||||
DataTable credentialTable
|
||||
)
|
||||
{
|
||||
await using SqlCommand command = new SqlCommand(
|
||||
"dbo.USP_AddUserCredentials",
|
||||
connection
|
||||
);
|
||||
command.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
SqlParameter tvpParameter = command.Parameters.Add(
|
||||
"@Hash",
|
||||
SqlDbType.Structured
|
||||
);
|
||||
tvpParameter.TypeName = "dbo.TblUserHashes";
|
||||
tvpParameter.Value = credentialTable;
|
||||
|
||||
await command.ExecuteNonQueryAsync();
|
||||
}
|
||||
|
||||
static async Task<DataTable> BuildCredentialTableAsync(SqlConnection connection)
|
||||
{
|
||||
const string sql = """
|
||||
SELECT ua.UserAccountID,
|
||||
ua.Username
|
||||
FROM dbo.UserAccount AS ua
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM dbo.UserCredential AS uc
|
||||
WHERE uc.UserAccountID = ua.UserAccountID);
|
||||
""";
|
||||
|
||||
await using SqlCommand command = new(sql, connection);
|
||||
await using SqlDataReader reader = await command.ExecuteReaderAsync();
|
||||
|
||||
DataTable table = new();
|
||||
table.Columns.Add("UserAccountId", typeof(Guid));
|
||||
table.Columns.Add("Hash", typeof(string));
|
||||
|
||||
while (await reader.ReadAsync())
|
||||
{
|
||||
Guid userId = reader.GetGuid(0);
|
||||
string username = reader.GetString(1);
|
||||
|
||||
string password = CreatePlainTextPassword(username);
|
||||
string hash = GeneratePasswordHash(password);
|
||||
|
||||
DataRow row = table.NewRow();
|
||||
row["UserAccountId"] = userId;
|
||||
row["Hash"] = hash;
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
static string CreatePlainTextPassword(string username) => $"{username}#2025!";
|
||||
|
||||
static string GeneratePasswordHash(string password)
|
||||
{
|
||||
byte[] salt = RandomNumberGenerator.GetBytes(16);
|
||||
|
||||
var argon2 = new Argon2id(Encoding.UTF8.GetBytes(password))
|
||||
{
|
||||
Salt = salt,
|
||||
DegreeOfParallelism = Math.Max(Environment.ProcessorCount, 1),
|
||||
MemorySize = 65536,
|
||||
Iterations = 4,
|
||||
};
|
||||
|
||||
byte[] hash = argon2.GetBytes(32);
|
||||
string saltBase64 = Convert.ToBase64String(salt);
|
||||
string hashBase64 = Convert.ToBase64String(hash);
|
||||
|
||||
// Store salt and hash together so verification can rebuild the key material.
|
||||
return $"{saltBase64}:{hashBase64}";
|
||||
}
|
||||
|
||||
static async Task ExecuteScriptAsync(SqlConnection connection, string sql)
|
||||
{
|
||||
foreach (string batch in SplitSqlBatches(sql))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(batch))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
await using SqlCommand command = new(batch, connection);
|
||||
await command.ExecuteNonQueryAsync();
|
||||
}
|
||||
}
|
||||
|
||||
static IEnumerable<string> SplitSqlBatches(string sql)
|
||||
{
|
||||
using StringReader reader = new(sql);
|
||||
StringBuilder buffer = new();
|
||||
|
||||
string? line;
|
||||
while ((line = reader.ReadLine()) is not null)
|
||||
{
|
||||
if (line.Trim().Equals("GO", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
yield return buffer.ToString();
|
||||
buffer.Clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
buffer.AppendLine(line);
|
||||
}
|
||||
|
||||
if (buffer.Length > 0)
|
||||
{
|
||||
yield return buffer.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
static string GetScriptPath(string fileName)
|
||||
{
|
||||
string projectRoot = Path.GetFullPath(
|
||||
Path.Combine(AppContext.BaseDirectory, "..", "..", "..")
|
||||
);
|
||||
string candidate = Path.Combine(projectRoot, fileName);
|
||||
|
||||
if (File.Exists(candidate))
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
|
||||
throw new FileNotFoundException(
|
||||
$"SQL script '{fileName}' was not found.",
|
||||
candidate
|
||||
);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
await using SqlConnection connection = new(ConnectionString);
|
||||
await connection.OpenAsync();
|
||||
Console.WriteLine("Connection to database established successfully.");
|
||||
|
||||
await BuildSchema(connection);
|
||||
await AddStoredProcsAndFunctions(connection);
|
||||
await RunSeedAsync(connection);
|
||||
Console.WriteLine("Seeding complete.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error.WriteLine($"Seeding failed: {ex.Message}");
|
||||
Environment.ExitCode = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user