Skip to content

Commit

Permalink
Add basic seed data for 2024 and instructions in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
russdaygh committed Apr 22, 2024
1 parent a1e9827 commit 3c46477
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
delete [UserSessionFeedback]
delete [UserEventFeedback]
delete [Sessions]
delete TimeSlots
delete Tracks
delete EventDetail


GO

DBCC CHECKIDENT ('[EventDetail]', RESEED, 0);
DBCC CHECKIDENT ('[Tracks]', RESEED, 0);
DBCC CHECKIDENT ('[TimeSlots]', RESEED, 0);
DBCC CHECKIDENT ('[Sessions]', RESEED, 0);

GO

Insert into EventDetail values (1, 'kn91wz1x')

Insert into Tracks values (1, 'Track 1','The Junction 🚉', 0)
Insert into Tracks values (1, 'Track 2','Brunel''s Boardroom 🎩🛹', 1)
Insert into Tracks values (1, 'Track 3','Brunel''s Breakout room 🎩☕', 2)
Insert into Tracks values (1, 'Track 4','Clock tower room ⏲', 3)

GO
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# PocketDDD

# Populating Sessionize data
Auto-populating the session data from Sessionize requires a basic set of seed data. An example of this can be found in [2024_SeedData.sql](PocketDDD.Server/PocketDDD.Server.DB/Migrations/2024_SeedData.sql)

Once this script has been run against the DB you can call the admin endpoint to refresh the data. This requires the Admin API key which can be retrieved from Azure key vault secret `pocketddd-<env>-admin-api-key`
```
POST /api/eventdata/RefreshFromSessionize HTTP/1.1
Host: pocketddd-dev-api-server.azurewebsites.net
Authorization: <insert-admin-key>
```

# Running terraform locally
Ensure the Azure, GitHub, and terraform CLIs are installed
```
Expand Down

0 comments on commit 3c46477

Please sign in to comment.