Skip to content

Database setup

Giang edited this page Aug 21, 2023 · 7 revisions

After you have done migrations by doing dotnet ef database update on EmployeeService, Locatie-service, and pakketservice. This 5 steps will make the app functional!

All tables

it will display buildings, cities, Package, Person, rooms, and Ticket tables after migrations.

Rider IDE in build database and SQL server management studio 19 (same result)

These are the tables you need for this app, if correct, down below is the data you need to actually make the app run functional.

1. Person table

0 = Admin and 1 = Employee role for different access.

Need minimal of 2 rows for (to make sense) for register and receiver. Best would be to make accounts for each Fontys developers.

Also do not manually add Id, it will do that automatically. Else error!

You can user your own info.

with the first step, you can login and see the dashboard.

2. cities table

Copy these values:

Id Name IsActive
9d581d1b-1a6e-4890-a331-758507035250 Tilburg 1
b04b6030-8133-42b1-b192-e138f4a9abe7 Eindhoven 1
75e668e5-07ed-4473-baf8-eb49a512cae3 Venlo 1

We use GUID generator to generate UUID for the Id's.

3. buildings table

Copy these values:

Notice that Address_CityId is the foreign key for the primary key Id in cities table.

Id Name Address_CityId Address_PostalCode Address_Number IsActive
f530bce2-fc32-4cc7-a721-376e9ca722db P8 9d581d1b-1a6e-4890-a331-758507035250 5022DM 1 1
cbce7afd-40dc-4414-afc8-4a4232e4e80b R10 b04b6030-8133-42b1-b192-e138f4a9abe7 5612MA 1 1
3e63db63-e369-40b7-a220-2a3abaab996e 12 75e668e5-07ed-4473-baf8-eb49a512cae3 5912BG 255 1
6da3ccf8-395f-42c3-b34b-d439505589ad P1 9d581d1b-1a6e-4890-a331-758507035250 5022DM 1 1

4. rooms table

Copy these values:

Notice that BuildingId is the foreign key for the primary key Id in buildings table.

Id Name BuildingId IsActive
83a8b225-36e7-4264-9108-049866b2cef4 0.45 f530bce2-fc32-4cc7-a721-376e9ca722db 1
02de426e-7fd3-4a05-8c89-79b91b88f400 1.15 f530bce2-fc32-4cc7-a721-376e9ca722db 1
9368b4c8-441f-45dc-8063-856dab129ba7 R10.2 cbce7afd-40dc-4414-afc8-4a4232e4e80b 1
e8fe6252-9086-4e82-b6e6-c07dfbfd2360 A2 3e63db63-e369-40b7-a220-2a3abaab996e 1

5. Package table

Copy these values:

Notice that CollectionPointId is the foreign key for the primary key Id in rooms table.

Id ReceiverId CollectionPointId Sender Name RouteFinished
d83f73ce-6994-475f-9204-3232e02cc4d4 1 02de426e-7fd3-4a05-8c89-79b91b88f400 Henk iPad 0

Result

See DEMO for populated data and showcase