Can i add new custom tables inside my aspnet database inside asp.net MVC-5 project

Viewed 2677

I have the following:-

  1. Visual Studio 2013.
  2. i created a new asp.net MVC-5 web project.
  3. the project is using asp.net identity 2.2.
  4. for the authentication method i chose "Individual user accounts"
  5. this process created a new database named aspnet-OurProjectNanme-number
  6. inside the automatically generated database, i have a table named AspNetUSers which store the user info.

now i am working on building an ERP system. and inside the ERP system i want to add the following:-

  1. a table named "Asset" to store the asset info.
  2. the "Asset" table will have 2 columns named "CreatedBy" + "ModifiedBy" which should store the userId who created and modified the asset item.

now i am not sure how i need to achieve this? as i need to add a foreign key between my custom table "Asset" and the "AspNetUsers" table which have been created automatically.. so can i add my custom table "Asset" inside the automatically generated database, and build the foreign key between the Asset.CreatedBy and AspNetUsers.Id ??

  • if the answer is Yes then can this relation break in the future if we want to upgrade our aspnet identity version ? as upgrading the identity might result in creating new tables or renaming existing ones etc.. which might break the relation between the Asset table and the AspNetUsers table?

  • If the answer is No (i should not add custom tables inside the automatically generated database ) then how i can build the foreign key ?? and where i need to add the Asset table in this case??

2 Answers
Related